






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
C949 Data Structures and Algorithms| 2026 Exams C949 Data Structures and Algorithms| 2026 Exams
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Tuple - Answer -A datatype that is immutable, which means that once it's been created, the elements can't be changed. It is also a sequence type. Is typically used when element position, and not just the relative ordering of elements is important. Named Tuple - Answer -An immutable datatype where the element position is important. Each element can have it's own designated name. Set - Answer -An ADT that serves as an unordered collection of unique elements. When created, the values should be contained within a sequence-type iterateable object. Intersection - Answer -Returns a new set containing only the elements in common between one set and all provided sets. Union - Answer -Returns a new set containing all of the unique elements in all sets. Difference - Answer -Returns a set containing only the elements of set that are not found in any of the provided sets. Symmetric Difference - Answer -Returns a set containing only elements that appear in exactly one of set A or set B. Dictionary - Answer -A python container used to describe associative relationships. It associates keys with values. A key can be any immutable type, such as a number, string, or tuple. A value can be any type. Numeric Data Type - Answer -A data type which supports all of the normal mathematical operations. These are the most common types used to store data. Sequence Data Type - Answer -Data types which are collections of objects ordered by position. Mapping Data Type - Answer -A data type used exclusively by the dict type. Each element is independent, which means there is no special ordering. Also uses key value pairs to associate a key with a value. Algorithm - Answer -A sequence of steps for accomplishing a task. Linear Search - Answer -A search algorithm that starts from the beginning of a list and checks each element until the search key is found or the end of the list is reached.
Runtime - Answer -The time it takes for an algorithm to execute. Binary Search - Answer -An algorithm for searching a list if the list's elements are sorted. It starts by checking the middle element of the list. If the search key is found, the algorithm returns the matching location. If not, the algorithm repeats the search on the remaining left sublist if the search key is less than the middle element, or on the remaining right sublist if it's larger. [log2N]+1 - Answer -The maximum number of steps required to reduce the search space to an empty sublist. Which of the following Big O Notations is equivalent to O(N+999)? - Answer -O(N) Which of the following Big O Notations is equivalent to O(734N)? - Answer -O(N) Which of the following Big O Notations is equivalent to O(12N)+6(N^3+1000)? - Answer -O(N^3) Simplify: 10O(N^2) - Answer -O(N^2) Simplify: 2N^3+O(N^2) - Answer -O(N^3) Simplify: log2N - Answer -O(logN) O(1) - Answer -Constant runtime complexity. O(logN) - Answer -Logarithmic runtime complexity. O(N) - Answer -Linear runtime complexity. O(NlogN) - Answer -Log-linear runtime complexity. O(N^2) - Answer -Quadratic runtime complexity. O(c^N) - Answer -Exponential runtime complexity. Selection Sort - Answer -A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly selects thee proper next value to move from the unsorted part to the end of the sorted part. Has a complexity of O(N^2) Insertion Sort - Answer -A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part. Has a complexity of O(N^2). For sorted or nearly sorted inputs, it's runtime is O(N).
NP-Complete Problems - Answer -A set of problems for which no known efficient algorithm exists. Alongside this, no one has proven an efficient algorithm to solve this problem is impossible, and if an efficient algorithm exists, then all of these problems can be solved efficiently. Efficient Program - Answer -An algorithm with a runtime that increases no more than polynomially with respect to the input size. Abstract Data Type (ADT) - Answer -A data type described by predefined user operations. List - Answer -An ADT for holding ordered data. Dynamic Array - Answer -An ADT for holding ordered data and allowing indexed access. Stack - Answer -An ADT in which items are only inserted on or removed from the top. Is referred to as a last-in first-out ADT. Queue - Answer -An ADT in which items are inserted at the end, and removed from the front. Is referred to as a first-in first-out ADT. Deque - Answer -An ADT in which items can be inserted and removed at both the front and back. Bag - Answer -An ADT for storing items in which the order does not matter and duplicate items are allowed. Priority Queue - Answer -An ADT where items are inserted at the end, and removed from the front. Each item has a priority, and items with a higher priority are closer to the front. Dictionary (Map) - Answer -An ADT that associates keys with values. Abstraction - Answer -To have a user interact with an item at a high-level, with lower- level internal details hidden from the user. Computational Complexity - Answer -The amount of resources used by the algorithm. Runtime Complexity - Answer -A function, T(N), that represents the number of constant time operations performed by the algorithm on an input of size N. Space Complexity - Answer -A function, S(N), that represents the number of fixed-size memory units used by the algorithm for the input of size N.
Auxiliary Space Complexity - Answer -The space complexity not including the input data. Constant Time Operation - Answer -An operation that, for a given process, always operates in the same amount of time, regardless of input values. O Notation - Answer -Provides a growth rate for an algorithm's upper bound. Ω Notation - Answer -Provides a growth rate for an algorithm's lower bound. Θ Notation - Answer -Provides a growth rate that is both an upper and lower bound. Recursive Algorithm - Answer -An algorithm that breaks the problem into smaller subproblems and applies the algorithm itself to solve the smaller subproblems. Recursive Function - Answer -A function that calls itself. Fibonacci Sequence - Answer -A numerical sequence where each term is the sum of the previous 2 terms in the sequence, except the first 2 terms, which are 0 and 1. Recurrence Relation - Answer -A function that is defined in terms of the same function operating on a value less than N. Recursion Tree - Answer -A visual diagram of an operation done by a recursive function, that separates operations done directly by the function and operations done by recursive calls. Shell Sort - Answer -A sorting algorithm that treats the input as a collection of interleaved lists, and sorts each list individually with a variant of the insertion sort algorithm. It uses the gap values to determine the number of interleaved lists. Gap Value - Answer -A positive integer representing the distance between elements in an interleaved list. If an element is at index i, the next element is at index i + this value. Radix Sort - Answer -A sorting algorithm designed specifically for integers. This algorithm makes use of a concept called buckets and is a type of bucket sort. It processes one digit at a time starting with the least significant digit and ending with the most. It works in two steps, one, all array elements are placed into buckets, then the array is rebuilt by removing all elements from the buckets, in order from lowest to highest. Bucket - Answer -A collection of integer values that all share a particular digit value, such as: 7, 77, 87, 27. Note, the shared value needs to be in the same decimal place.
Is Operator - Answer -An operator used to test if two objects share the same memory location. Doubly-Linked List - Answer -A data structure for implementing a list ADT, where each node has data, a pointer to the next node, and a pointer to the previous node. The list structure typically points to the first node and the last node. It uses pointers to both the next and previous nodes. Positional List - Answer -A list where elements contain pointers to the next and/or previous elements in the list. A doubly-linked list is an example. Which Characteristic of an Algorithm is Independent in Nature? - Answer -Uses an agnostic code repository What is Referred to as a Data Structure that Stores Subitems? - Answer -Record Which Term Refers to a Type of Search Algorithm? - Answer -Linear What Data Type do Heap Sorts Work With? - Answer -Tree-based data structure What Function is Used in Conjunction With a Merge Sort Algorithm? - Answer - Recursion Which Search Algorithm Has The Best Performance When the Data Set is Sorted? - Answer -Interval Search Which Format is Used to Store Data in a Hash Table? - Answer -Array Which Term Refers to a Data Structure That Groups Related Items of Data Together? - Answer -Record Which Data Structure is Used to Store Unordered Items by Mapping Each Item to a Location in an Array? - Answer -Hash Table What is an Advantage That a Linked List Has Over an Array? - Answer -Grows and shrinks as needed What Would be the Best Data Structure for a Hash Table with Simple Chaining? - Answer -Doubly-linked list What is the Height of this Tree? - Answer -Two What is the Resulting Stack When the Push(1) Function is Implemented on this Stack Yield? - Answer -1,8,9,3,
Which Term Describes a Way of Organizing, Storing and Performing Operations on Data? - Answer -Data structure Which Characteristic of a Class Allows it to be Used as an ADT? - Answer -It consists of variables and methods What is the First Element Visited in this List When Binary Searching for The Number 7? [6,7,8,9,11,15,20] - Answer - What is the Runtime Complexity of the Algorithm O(N^N + 1)? - Answer -Exponential Which ADT is Characterized by the LIFO Principle? - Answer -Stack Which Python List Function Removes the First Instance of the Specified Element? - Answer -Remove() How Does the Insertion Sort Algorithm Sort Through a List? - Answer -By iterating through the sorted list while placing each value into its sorted position within the list. What is the Average Runtime Complexity of the Merge Sort Algorithm? - Answer - O(N*log(N)) What is the Midpoint Given the Quicksort on this List? (43, 3, 72, 18, 2, 28, 51, 111, 66, 71) - Answer - What is the Pivot Point Given the Quicksort on this List? (43, 3, 72, 18, 2, 28, 51, 111, 66, 71) - Answer - Which Tool in Python is Used to Implement a Deque ADT? - Answer -Collections Which Operator is a Type of Assignment Operator? - Answer -+= List Traversal - Answer -An algorithm which visits all nodes in the list once and performs an operation on each node. Dummy Node (Header Node) - Answer -A node with an unused data member that always resides at the head of the list and cannot be removed. Array-Based List - Answer -A list ADT implemented using an array. An Array-Based List Can Have a Default Allocation Size of 0. - Answer -False Enqueue - Answer -A queue operation that inserts an item at the end of the queue.
Quadratic Probing - Answer -A collision resolution technique that handles a collision by starting at the key's mapped bucket, and then quadratically searches subsequent buckets until an empty bucket is found. The formula: (H+c1i+c2+i^2)%(tablesize). c and c2 are programmer defined constants for quadratic probing. (H+c1i+c2+i^2)%(tablesize) - Answer -Quadratic probing formula. Probing Sequence - Answer -The sequence of keys iterated through when attempting to obtain the desired table index. Double Hashing - Answer -An open-addressing collision resolution technique that uses 2 different hash functions to compute bucket indices. Double Hashing Key Index Formula - Answer -(h1(key)+i*h2(key))mod(tablesize) Load Factor - Answer -The number of items in the hash table divided by the number of buckets. This number may be used to decide when to resize the hash table. Instances Where Hash Tables May Be Resized - Answer -High load factor, the number of collisions during an insertion (open-addressing), and the size of a bucket's linked-list (chaining). Perfect Hash Function - Answer -A hash function which maps items into buckets with no collisions. The runtime for insert, search and remove is O(1) with a perfect hash function. Modulo Hash Function - Answer -Uses the remainder from division of the key by hash table size N. key % N Mid-Square Hash - Answer -A hash function that squares the key, extracts R digits from the result's middle, and returns the remainder of the middle digits divided by the hash table size N. Multiplicative String Hash - Answer -Repeatedly multiplies the hash value and adds the ASCII value of each character in the string. Direct Hash Function - Answer -Uses the item's key as the bucket index. Direct Access Table - Answer -A hash table with a direct hash function. Leaf - Answer -A tree node with no children. Internal Node - Answer -A node with at least one child. Parent - Answer -A node with a child is said to be that child's parent.
Ancestors - Answer -Includes the node's parent, the parent's parent, etc all the way up to the root. Root - Answer -The one tree node with no parent. Edge - Answer -The link from a node to a child. Depth - Answer -The number of edges on the path from the root to the node. Level - Answer -All nodes with the same depth form this. Height - Answer -The largest depth of any node. A tree with one node is 0. Full - Answer -A binary tree if every node contains 0 or 2 children. Complete - Answer -A binary tree if all levels, except possibly the last level, contain all possible nodes and all nodes in the last level are as far left as possible. Perfect - Answer -A binary tree if all internal nodes have 2 children and all leaf nodes are at the same level. Binary Space Partitioning - Answer -A technique of repeatedly separating the region of space into 2 parts and cataloging objects contained within the regions. BSP Tree - Answer -A binary tree used to store information for binary space partitioning. Unambiguity - Answer -It is clear by the description of the algorithm what it does, which leads to correct implementations and reliable results. The same input should always produce the same output. Finiteness - Answer -The algorithm should end after a finite amount of time, and it should have a limited number of instructions. Language Independent - Answer -A algorithm which can easily be ported to different programming languages and platforms, making it more adaptable and usable across various environments. Feasibility - Answer -Indicates that an algorithm is practical and capable of being executed within reasonable constraints and resources. Effectiveness - Answer -Indicates that an algorithm avoids excessive execution times. Brute-Force Algorithm - Answer -An algorithm that exhaustively tries all possible solutions.