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