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

Insertion of a node into an avl tree, Initially Nodes are inserted in an AV...

Initially Nodes are inserted in an AVL tree in the same manner as an ordinary binary search tree. Though, the insertion algorithm for any AVL tree travels back along with the pa

Sparse matrices, SPARSE MATRICES Matrices along with good number of zer...

SPARSE MATRICES Matrices along with good number of zero entries are called sparse matrices. Refer the following matrices of Figure (a)

Write an algorithm inputs speed of cars using pseudocode, Write an algorith...

Write an algorithm by using pseudocode which: Inputs top speeds of 5000 cars Outputs fastest speed and the slowest speed Outputs average speed of all the 5000 cars

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

Mcs-021, #questWrite an algorithm for multiplication of two sparse matrices...

#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..

What is class invariants assertion, What is Class invariants assertion ...

What is Class invariants assertion A class invariant is an assertion which should be true of any class instance before and after calls of its exported operations. Generally

Structures for complete undirected graphs, Q. Draw  the structures of compl...

Q. Draw  the structures of complete  undirected  graphs  on  one,  two,  three,  four  and  five vertices also prove that the number of edges in an n vertex complete graph is n(n-1

A full binary tree with 2n+1 nodes, A full binary tree with 2n+1 nodes have...

A full binary tree with 2n+1 nodes have n non-leaf nodes

Algorithms, characteristics of a good algorithm

characteristics of a good algorithm

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