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