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