Data Structure interview questions – page 11
893 questions. Tap “Show answer” to check yourself.
-
You have more than 3 million entries of phone numbers. You have to create a phone book just like the one we have on the new phones these days. You type the name, and the numbers that match the letters you typed shows up on your phone.
-
Write a C code to find Leftmost right cousin at the same level.
-
What is the possible problem if Hash Table grows more than 30 gb (ignore problems like bad hash function)
-
A dictionary of words is given ...besides that it also includes an extra condition that the words r also sorted based on length..
-
How to free memory allocated to an array with new function?
-
What is Ternary Search ? They will be fast to Binary search or not.
-
Find all the patterns once which are present in the character array given. A pattern is a sub-array containg 2 or more chars. Ex: i/p: aabcdadabc o/p: ab, abc, bc, da
-
Given an n-ary tree , you have to search for an element in the tree without using recursion. int FindNum(node *head, int num) {
-
You are given a bst where each node has a int value , parent pointer , and left and right pointers , write a function to find a path with a given sum value. Path can go from left subtree tree , include root and go to right tree as well . we need t...
-
Given an n-ary tree of resources arranged hierarchically. A process needs to lock a resource node in order to use it. But a node cannot be locked if any of its descendant or ancestor is locked. You are supposed to:
-
How would you remove alternate nodes of a given linked list?
-
Given a binary tree write efficient code to make it balance binary tree..interview wants from me clear code & appropach
- Advertisement
-
How to implement circular queue using array? what is the time complexity of enqueue and dequeue operations?
-
Print Reverse of linked list (dont reverse it) with only constant space.
-
Code for finding the longest increasing sub-sequence
-
Write code for 2 functions i) writing the contents of a n-ary tree to a file ii) forming the n-ary tree again given the file u just created in the previous step
-
Given a string *Str of ASCII characters, write the pseudocode to remove the duplicate elements present in them. For example, if the given string is "Potato", then, the output has to be "Pota". Additional constraint is, the algorithm has to be in-p...
-
Create a singly linked list from the Leaf nodes from a binary tree. Tree may be balanced or not. Linked List should be created in place (tree nodes should be used)
-
Write a function to output the minimum string to be appended to the given string such that the new string so formed is a palindrome.
-
Given a binary tree, and 3 nodes x,y,z write a function which returns true if y lies in the path between x and z and false otherwise.
-
Given a binary tree and two nodes, how do you check if there exist a path between them.
-
How do you find the largest repeating string and the number of times it repeats in a given string efficiently off-course !?
-
Given a value and a binary search tree. Print all the paths(if there exists more than one) which sum up to that value. It can be any path in the tree. It doesn't have to be from the root.
-
Find bugs in the xstrrev function.
- Advertisement
-
An N-ary tree has N sub-nodes for each node, it has M non-leaf nodes. Find the no of leaf nodes?
-
Given a binary tree convert it into double linked list
-
Find the Median of a Binary Search Tree
-
Given a stack and any other data structure, write the code for push() , pop(), max_stack() in O(1) complexity.
-
Given a set of words in a dictionary, write a program to group all words which are anagrams of each other in to sets. You can use any C++ STLs or other languages like python if you want to code this..
-
Given post order traversal of a BST, construct the BST. Also specify the time and space complexity