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