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