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