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