# Category 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
Given a Binary Tree, check if all leaves are at same level or not.  12 / \ 5 7 / \ 3 1 Leaves are… Read More
Write a code to get the depth of the deepest odd level leaf node in a binary tree. Consider that level starts with 1. Depth… 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
AuxiliaryGiven Inorder and Preorder traversals of a binary tree, print Postorder traversal. Example: Input: Inorder traversal in[] = {4, 2, 5, 1, 3, 6} Preorder… 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 linked lists, insert nodes of second list into first list at alternate positions of first list. For example, if first list is 5->7->17->13->11 and… Read More
Given a Binary Tree, find the difference between the sum of nodes at odd level and the sum of nodes at even level. Consider root… 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
VMWare interview for MTS-2 position. I Telephonic round 1. Given an array of strings. Find the maximum prefix among all the strings. Ans: First told… Read More
Eulerian Path is a path in a graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path that starts and ends on the… Read More