A) Red-Black tree B) AVL tree C) binary search tree (BST) D) B-tree
A) The number of nodes on the path from the root to that node B) The value of the node C) The number of levels in the tree D) The height of the node
A) AVL tree B) Red-Black tree C) Binary search tree (BST) D) B-tree
A) Level order B) Postorder C) Preorder D) Inorder
A) Leaf node B) Root node C) Sibling node D) Internal node
A) The height of the tree B) The number of edges from the root to the deepest leaf C) The maximum number of children of any node D) The total number of nodes
A) 0 B) 2 C) 3 D) 1
A) Binary search tree B) B-tree C) Trie D) AVL tree
A) AVL tree B) Binary tree C) B-tree D) Trie
A) Preorder B) Level order C) Inorder D) Postorder
A) The number of leaves in the tree B) The number of nodes in the tree C) The maximum number of children a node can have D) The distance from the root to the deepest leaf
A) Postorder B) Preorder C) Inorder D) Level order
A) Internal node B) Sibling node C) Leaf node D) Unary node
A) A hash table B) A hierarchical data structure C) A linear data structure D) A graph
A) It must be a left child. B) It must be a right child. C) It cannot have only one child. D) It could be either a left or a right child.
A) To store data in a sorted order B) To store data in a random order C) To ensure the tree is balanced D) To minimize the height of the tree
A) Internal node B) Sibling node C) Unary node D) Leaf node
A) Logarithmic in the number of nodes B) Quadratic in the number of nodes C) Linear in the number of nodes D) Constant
A) A collection of edges B) A route connecting two nodes C) A set of all nodes in the graph D) A cycle without any vertices
A) There are no edges B) It has multiple components C) It is a directed graph only D) All vertices are reachable from one another
A) A collection of nodes and edges B) A linear data structure C) A collection of arrays D) A type of tree
A) Prim's algorithm B) Dijkstra's algorithm C) Kruskal's algorithm D) Depth-first search
A) Vertices that form a cycle B) Two sets of vertices where edges only connect nodes from different sets C) A single set of vertices D) Only one vertex
A) The number of paths from that vertex B) The distance to the farthest vertex C) The total number of vertices in the graph D) The number of edges connected to it
A) A connection between two vertices B) The distance between two vertices C) The number of vertices in a graph D) The total number of edges
A) The edge does not exist B) The edge connects two nodes of different types C) The edge can be traversed in both ways D) The edge can only be traversed in one way
A) 0 or 1 B) Infinite C) 1 or more D) Exactly 2
A) A graph with no edges B) A graph where edges have values associated with them C) A graph where vertices have weights D) A graph where all edges have the same weight
A) To represent node and edge connectivity in a graph. B) To simplify graph traversal. C) To store edge weights only. D) To perform sorting operations.
A) A graph that can be divided into two or more subgraphs B) A graph that contains cycles C) A graph where all vertices are connected by edges D) A graph with no edges
A) It is always directed. B) It allows weighted edges. C) It has no parallel edges or self-loops. D) It contains at least one cycle.
A) A disconnected graph B) A closed path where the starting and ending vertices are the same C) A path that visits every vertex D) A graph with no edges
A) Stack B) Array only C) Linked list D) Adjacency matrix
A) Undirected Graph B) Directed Graph C) Bipartite Graph D) Complete Graph
A) Complete Graph B) Weighted Graph C) Bipartite Graph D) Directed Graph
A) A linear data structure B) A non-linear data structure C) A hierarchical data structure D) A data type in C++
A) The last item added B) The first item added C) The item at random D) The item in the middle
A) Push B) Enqueue C) Pop D) Dequeue
A) Pop B) Dequeue C) Enqueue D) Push
A) tree B) queue C) linked list D) stack
A) Only insertion B) Insertion at one end and deletion at the other end C) Only deletion D) Insertion and deletion at both ends
A) An error is generated B) Elements are added at the beginning of the queue C) Elements are added at the end of the queue D) Elements are discarded
A) Circular Queue B) Deque C) Banana queue D) Priority Queue
A) O(1) for both enqueue and dequeue B) O(n) for both enqueue and dequeue C) O(n) for both enqueue and dequeue D) O(n) for enqueue and O(1) for dequeue
A) Using arrays B) Using stacks C) Using linked lists D) Using dynamic arrays
A) A queue in which elements are processed based on their priority B) A queue that processes elements in a random order C) A queue that gives priority to older elements D) A queue with a fixed size
A) Circular queue B) Stack C) Queue D) Binary heap
A) A deque can only enqueue elements at the front. B) A deque can only dequeue elements from the front. C) A deque can enqueue and dequeue elements at both ends. D) A regular queue is faster than a deque.
A) The element added least recently B) The element with the lowest priority C) The element with the highest priority D) The element added most recently
A) Priority Queue B) Circular Queue C) deque D) Normal Queue
A) Priority Queue B) Circular Queue C) Stack D) Deque
A) m B) n-m C) 0 D) n
A) The first element added is processed first. B) The order is implementation-specific. C) The last element added is processed first. D) They are processed in a random order.
A) Print spooling B) Breadth-first search (BFS) C) Sorting algorithms D) Undo functionality in text editors
A) Dequeue B) None of the above C) Both enqueue and dequeue D) Enqueue
A) dequeue() B) front() C) remove_front() D) pop_front()
A) No advantage; they are equivalent B) Faster enqueue operation C) Better memory utilization D) Simpler implementation
A) Cache B) Circular Queue C) Deque D) Priority Queue
A) Circular Queue B) Deque C) Stack D) Priority Queue
A) It may lead to wasted memory for a large maximum size. B) It allows for dynamic sizing. C) It has faster enqueue and dequeue operations. D) It is not suitable for implementing a priority queue.
A) The element with the highest value B) The last element added C) The first element added D) The element with the lowest value
A) Normal Queue B) Priority Queue C) Circular Queue D) Deque
A) Linked List B) heap data structure C) Binary Tree D) Stack
A) remove_back() B) pop_back() C) dequeue() D) back()
A) Priority Queue B) Normal Queue C) Age-Ordered Queue D) Circular Queue
A) Circular queues cannot be full. B) Check if the front pointer is ahead of the rear pointer by 1. C) Compare the rear and front pointers modulo the queue size. D) Check if the rear pointer is ahead of the front pointer by 1.
A) The element with the higher value is removed. B) The element with the lower value is removed. C) It's implementation-dependent. D) The element added first is removed.
A) Unambiguous B) Output C) Feasibility D) Input E) Dependent
A) Time complexity B) Efficiency C) Abstraction D) Reusability E) Space Complexity
A) Reusability B) Abstraction C) Efficiency D) Time complexity E) Space Complexity
A) Efficiency B) Reusability C) Time complexity D) Abstraction
A) Linear or non-linear B) Homogeneous or non-homogeneous C) Static or dynamic
A) Static or dynamic B) Homogeneous or non-homogeneous C) Linear or non-linear
A) Homogeneous or non-homogeneous B) Linear or non-linear C) Static or dynamic
A) User B) Content C) Data classification D) Context |