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