# Tag Archives: Data Structures

Given pointer to a node X in a singly linked list. Only one pointer is given, pointer to head node is not given, can we… Read More
Consider the following pseudo code. Assume that IntQueue is an integer queue. What does the function fun do? void fun(int n) {     IntQueue q =… Read More
Is it possible to create a doubly linked list using only one pointer with every node. (A) Not Possible (B) Yes, possible by storing XOR… Read More
What are the time complexities of finding 8th element from beginning and 8th element from end in a singly linked list? Let n be the… Read More
Given two max heaps of size n each, what is the minimum possible time complexity to make a one max-heap of size from elements of… Read More
Which of the following data structures is best suited for efficient implementation of priority queue? (A) Array (B) Linked List (C) Heap (D) Stack Answer:… Read More
Consider a situation where a client receives packets from a server. There may be differences in speed of the client and the server. Which data… Read More
Which data structure is best suited for converting recursive implementation to iterative implementation of an algorithm? (A) Queue (B) Stack (C) Tree (D) Graph Answer:… Read More
In which scenario would a directed acyclic graph (DAG) be most suitable? (A) Representing dependencies between tasks in a project schedule (B) Modeling a social… Read More
Consider a node X in a Binary Tree. Given that X has two children, let Y be Inorder successor of X. Which of the following… Read More
Which of the following is FALSE about B/B+ tree (A) B/B+ trees grow upward while Binary Search Trees grow downward. (B) Time complexity of search… Read More
Consider the same code as given in above question. What does the function print() do in general? The function print() receives root of a Binary… Read More
Consider the following code snippet in C. The function print() receives root of a Binary Search Tree (BST) and a positive integer k as arguments.… Read More
Which among the following data structures is best suited for storing very large numbers (numbers that cannot be stored in long long int). Following are… Read More
Which of the following traversals is sufficient to construct BST from given traversals 1) Inorder 2) Preorder 3) Postorder (A) Any one of the given… Read More