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