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