Sort the Sequence Using Merge Sort, Data Structure & Algorithms

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]

 

Posted Date: 7/10/2012 5:04:49 AM | Location : United States







Related Discussions:- Sort the Sequence Using Merge Sort, Assignment Help, Ask Question on Sort the Sequence Using Merge Sort, Get Answer, Expert's Help, Sort the Sequence Using Merge Sort Discussions

Write discussion on Sort the Sequence Using Merge Sort
Your posts are moderated
Related Questions

Q. Let us consider a queue is housed in an array in circular fashion or trend. It is required to add new items to the queue. Write down a method ENQ to achieve this also check whet

In this example, suppose the statements are simple unless illustrious otherwise. if-then-else statements if (cond) { sequence of statements 1 } else { sequence of st

null(nil) = true                     // nil refer for empty tree null(fork(e, T, T'))= false   //  e : element , T and T are two sub tree leaf(fork(e, nil, nil)) = true leaf(

Explain the Assertions in Ruby Ruby offers no support for assertions whatever. Moreover, because it's weakly typed, Ruby doesn't even enforce rudimentary type checking on opera

An adjacency matrix representation of a graph cannot having information of : Parallel edges

Definition: A set of data values & related operations that are accurately specified independent of any particular implementation. As the data values and operations are described

algorithm for insertion in a queue using pointers

Define the terms     i) Key attribute     ii) Value set  Key attribute:  An entity  type  usually  has  an attribute  whose  values  are  distinct  fr

Inorder traversal: The left sub tree is visited, then the node and then right sub-tree. Algorithm for inorder traversal is following: traverse left sub-tree visit node