Sort the Sequence Using Merge Sort, Data Structure & Algorithms

Assignment Help:

Q. Sort the sequence written below of keys using merge sort.

66, 77, 11, 88, 99, 22, 33, 44, 55                                                                     

Ans:

Sorting using Merge sort technique:-

Original File       [66] [77] [11] [88] [99] [22] [33] [44] [55]

Pass1     [66 77] [11 88] [22 99] [33 44] [55]

Pass2         [11 66   77   88] [22 33   44   99] [55]

Pass3         [11 22   33   44   66   77   88   99] [55]

Pass4   [11 22   33   44   55   66   77   88   99]

 


Related Discussions:- Sort the Sequence Using Merge Sort

Breadth first search, While BFS is applied, the vertices of the graph are d...

While BFS is applied, the vertices of the graph are divided into two categories. The vertices, that are visited as part of the search & those vertices that are not visited as part

Rl rotation - avl tree, Example: (Double left rotation while a new node is ...

Example: (Double left rotation while a new node is added into the AVL tree (RL rotation)) Figure: Double left rotation when a new node is inserted into the AVL tree A

Algorithm, Write an algorithm for compound interest.

Write an algorithm for compound interest.

Algorithm to merge the lists together, Q. Let X = (X1, X2, X3,....Xn) and Y...

Q. Let X = (X1, X2, X3,....Xn) and Y= (Y1, Y2, Y3,....Xm) be the two linked lists respectively. Write down an algorithm to merge the lists together to get the linked list Z such th

Red black tree, red black tree construction for 4,5,6,7,8,9

red black tree construction for 4,5,6,7,8,9

Write an algorithm insert, Q. Write an algorithm INSERT which takes a point...

Q. Write an algorithm INSERT which takes a pointer to a sorted list and a pointer to a node and inserts the node into its correct position or place in the list.  Ans: /* s

Illustrate the varieties of arrays, Varieties of Arrays In some languag...

Varieties of Arrays In some languages, size of an array should be established once and for all at program design time and can't change during execution. Such arrays are known a

Give example of assertion and abstract data type, Give example of assertion...

Give example of assertion and abstract data type For illustration, consider Natural ADT whose carrier set is the set of non-negative integers and whose operations are the usual

Explain the linked list implementation of stack, Question 1 Explain the fo...

Question 1 Explain the following? Arrays Stack Trees Question 2 Explain the Linked list implementation of stack Question 3 What is a binary tree? Expla

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd