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