Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Data Structure Algorithm Sorting with Question And Answer
Description: This type of Question And Answer is very important for your Data Structure Algorithm Interviews make a note friends

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


7
...

What is the main component of the Merge sort algorithm?
The main component of the Merge sort algorithm is the merge function
...

What is the logic of the merge function?
The logic of the merge function is as follows:
1
...

2
...
If a[i] is less than or equal to a[j], then put a[i] in the merged
array and increment i
...

3
...

4
...

5
...

What is the time complexity of Merge sort?
The time complexity of Merge sort is O(nlogn) in both the worst and best cases
...
Then, the sorted sublists are merged to form a new sorted
list
...

How does merge sort work?
In merge sort, the given list is divided into two halves recursively, sorted individually, and then
merged to form a new sorted list
...
Pointers are used to keep
track of the progress in each sublist until one sublist is completely added
...


Can you explain the recursive tree for merge sort?
Yes
...
Here is an example of a recursive tree for merge sort: [visual
representation explanation]
Title: Data Structure Algorithm Sorting with Question And Answer
Description: This type of Question And Answer is very important for your Data Structure Algorithm Interviews make a note friends