Data Structure interview questions – page 4
893 questions. Tap “Show answer” to check yourself.
-
Which data structure gives efficient search 1 B-tree 2 binary tree 3 array 4 linked list
-
Given 3 arrays x[],y[],z[] all sotted
-
Write a program to add two long positive numbers (each represented by linked lists)
-
What is the best sorting method for almost sorted array? a.quicksort c.hapsort c.shell sort d.bubble
-
Find least 4 numbers in an array.
-
Write a graph class and interface for the graph in C++
-
Design a data structure to represent the movement of a knight on a chess board.
-
You are given an array that contains integers. The integers content is such that every integer occurs 3 times in that array leaving one integer that appears only once. Fastest way to find that single integer -- using memory. -- not usi...
-
Given a integer matrix of size m*n. We need to find a sub matrix with the largest sum.
-
Is there any algorithm using omparisons that check array duplication in O(n) time limit? i.e., Suppose we have a array of type double. Then I need a function like this
-
Given a binary tree. Find the sum( inclusive of the root ) of sub-tree rooted at each node. Print the sum in in-order.
-
Time complexities for basic insert, search and delete operations on HashTable, Linked List, Binary Search, Array.
- Advertisement
-
There is a single Linked List, reverse the list using only one extra pointer ..i.e you can create only one extra pointer other than the head.
-
2D array sorted row wise and column wise. Find an element 'n' in an optimal way.
-
Best method to find out whether a given array already sorted,is sorted or not in min. time
-
Support n stacks using an array
-
Data structure used for proority queue a) linked list b) double linked list c) array d) tree
-
Modified 2 color sort problem i.e. you are given an array of integers containing only 0s and 1s.You have to place all the 0s in even position and 1s in odd position. And if suppose, no. of 0s exceed no. of 1s or vice versa then keep them untouched...
-
Reversing linked list recursively returning the head without any global variables at all
-
Given two arrays A and B. A has integers unsorted. B has the same length as A and its values are in the set {-1,0,1} you have to return an array C with the following processing on A. if B has 0 then C must have A if B...
-
Design a data structure for dequeue that supports the operations deleteLeft, deleteRight, InsertLeft, InsertRight. Write the function DeleteRight ensuring the correctness and synchronisation. All functions may try to modify the dequeue. You can us...
-
Write a function which takes 2 arrays- One array is the source array and the other array is the array of indices and delete all those elements present at the indices of the source array taking the indices from the second array.
-
A graph is given with "n" nodes, having the property symmetric and transitive. Write a code to proof all the nodes of the graph can communicate with each other.
-
Implement a stack that pops out the most frequently added item. Stack supports 3 functions - push, pop,and top. Give complexity of each functions in your implementation.
- Advertisement
-
Given an array of m+n elements in the range 1 to n ie(m elements are repeated). Find the duplicate elements. Time Complexity: O(m+n)
-
How to Implement a Queue with a Priority Queue. Similarly how woud you implement Stack with Priority Queue
-
You have to read a text file and maintain count of the occurrences of words in the text. for e.g. how are you doing? Are you ok? we have are and you coming twice and all others are occurring just once . So all you have to do i...
-
Find pair of number in given array whose sum is given
-
Convert Sorted List to Balanced Binary Search Tree (BST)
-
Find out all the elements in a sorted integer array whose value is equal to index of the array. O(logn) solution is expected.