First time user?    |

#### Select chapter

functions (3.papers)
loops (1.papers)
arrays (2.papers)
structures (3.papers)
unions (1.papers)
pointers (7.papers)
null pointers (1.papers)
strings (2.papers)
misc c concepts (1.papers)
Data structures (5.papers)
trees (1.papers)
basics (5.papers)
Hide

# c data structures interview questions and answers

Share
Share
Share
Share
5
`What is the run time complexity of quick sort, if array is already in sorted order?`
1. `if array is already in sorted order, then quick sort will always run in O(n^2)`
2. `if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is starting element.`
3. `if array is already in sorted order, then quick sort will run in O(n^2) if the pivot is random element.`
4. `if array is already in sorted order, still quick sort will run in O(n log n)`
Share
6
`What is the difference between bucket sort and counting sort?`
1. `counting sort - takes more memory for arrays compared to bucket. Bucket sort - is less efficient for linked lists compared to counting sort.`
2. `counting sort - takes less memory for arrays compared to bucket. Bucket sort - is less efficient for linked lists compared to counting sort.`
3. `counting sort - takes more memory for arrays compared to bucket. Bucket sort - is more efficient for linked lists compared to counting sort.`
4. `counting sort - takes less memory for arrays compared to bucket. Bucket sort - is more efficient for linked lists compared to counting sort.`
Share
Share
Share
Share
10
```What is heap sort and merge sort?
which of the below statements are true about heap sort, and merge sort?```
1. ```merge sort is - recursive merging
quick sort is - recursive partitioning```
2. ```merge sort is - recursive partitioning
quick sort is - recursive partitioning```
3. ```merge sort is - recursive partitioning
quick sort is - recursive merging```
4. ```merge sort is - recursive merging
quick sort is - recursive merging```
Share
11
`What is the difference between quick sort and merge sort?`
1. `Merge sort - first we will merge the unsorted list, and then sort. Quick sort - first we will sort recursively and then partition the arrays.`
2. `Merge sort - first we will sort smaller lists, and then merge into bigger list. Quick sort - first we will sort recursively and then partition the arrays.`
3. `Merge sort - first we will sort smaller lists, and then merge into bigger sorted list. Quick sort - first we will recursively partition, and then recursively sort.`
4. `Merge sort - first we will sort smaller lists, and then merge into bigger list. Quick sort - first we will recursively sort, and then recursively partition bigger arrays.`