Data Structure interview questions – page 10
893 questions. Tap “Show answer” to check yourself.
-
How to Implement stack using priority queue?
-
Design the data structures for an online book reader system ?
-
Do a BFS in given binary tree do find whether the given element in the tree or not.
-
How would you store 1 million phone numbers?
-
Lets say you have 1 string of length N and M small strings of length L. How do you efficiently find the occurence of each small string in the big string ?
-
Write a C program to convert a BST (Bin search tree) into DLL (Doubly Linked List) of increasing nodes values. The constraint is to write a recursive program, no other solution will be accepted.
-
Merge two BSTs into a single BST. Do it in place.
-
How to allocate memory to a string at run time and read character by character?
-
Find the distance of a node from the root in a binary tree.Print error message if node doesn't exist. Extend the problem to distance of any node to any other node that is below it.
-
Given an array that contains 0, 1 and 2 only, sort it.
-
I/P: Binary tree. O/P: Single Linked List where each node is the sum of the nodes in the same level of the binary tree.
-
Write Merge Sort
- Advertisement
-
There is a web server containing several files every time a user logs in open a file and a entry is made for that file in the log file. log file contains file name that has been opened and time of opening the file, in a day thousands of users log...
-
Write a program to find depth of binary search tree without using recursion.
-
Swap adjacent nodes of given linked list using one pointer
-
Given a single linked list, there is a possibility of pointer corruption, modify the data structure to ensure that the data is not lost.
-
There is a binary tree(Not a BST) in which you are given three nodes x,y,z. Write a function which finds whether y lies in the path b/w x and z.
-
Doublets is a word puzzle game invented by Lewis Carroll where the objective is to turn one dictionary word into another by changing one letter at a time. At each step, one letter may be changed, and the resulting word must be a valid dictionary w...
-
You are given an unsorted array of integers. You have to find out the first sub array whose elements when added sum up to zero. eg:- int Array[] = {1,2,-4,-3, 6 ,-3.....}Here sub array is -3,6,-3 bcos adding all these sum to zero. A sub array can...
-
Given preorder traversal of a Binary Search Tree. From the given options you have to select which one can possibly be the inorder traversal of the tree.
-
Written-Qn-2) Write complete working code (only the function) to traverse a binary tree in ZigZag order.
-
How to confirm that whether or not a given string in form of pZq , where p is a string and q is reverse of p and Z is a single character in O(n).Remember ,You may only fetch the next character of the given string.
-
Inserting an element into a sorted linked list.
-
You are given a binary tree where each node consists of a left pointer, a right pointer, and a sibling pointer. The left and right pointers are initially populated and the tree is a normal binary tree. He wanted a function to populate the sibling ...
- Advertisement
-
Write code to find first non repeating character in given string
-
Construct tree from given inorder and preorder traversals
-
Find if one string is a rotation of another eg str1="abcdef" str2="defabc" return true
-
Take input from console and print it in reverse way..... need to write test cases for this
-
Your are given two strings A and B. Output true if all the character in string A are present in String B. The solution should be optimal in time and space. For egs.. A="ppppppppppaaaaaaaaaa" B="pa" Output = true
-
Input is n strings.