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