Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Merge Sort In Java

In this example we are going to sort integer values of an array using merge sort.

Tutorial Details:

In merge sorting algorithm unsorted values are divided into two equal parts iteratively. Then merge both parts and sort it. Then again merge the next part and sort it. Do it iteratively until the values are not in sorted order.

In merge sorting the number of elements must be even. The merge sorting is invented by John von Neumann in 1945 .

The complexity of the merge sorting is in worst-case O(n log n) and in average case O(n log n).


 

Rate Tutorial:
http://www.roseindia.net/java/beginners/arrayexamples/mergeSort.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Merge Sort In Java

View Tutorial:
Merge Sort In Java

Related Tutorials:

Java Q&A - Java Still Open
Java Q&A - Java Still Open
 
Programming Java threads in the real world, Part 9 - JavaWorld June 1999
Programming Java threads in the real world, Part 9 - JavaWorld June 1999
 
Java memory management
Java memory management
 
Product Review: Kawa 4.0 - JavaWorld June 2000
Product Review: Kawa 4.0 - JavaWorld June 2000
 
The Lucene search engine: Powerful, flexible, and free - JavaWorld September 2000
The Lucene search engine: Powerful, flexible, and free - JavaWorld September 2000
 
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000
Validation with Java and XML Schema, Part 2 - JavaWorld October 2000
 
Validation with Java and XML schema, Part 4 - JavaWorld December 2000
Validation with Java and XML schema, Part 4 - JavaWorld December 2000
 
J2ME: The next major games platform? - JavaWorld March 2001
J2ME: The next major games platform? - JavaWorld March 2001
 
Jato: The new kid on the open source block - JavaWorld March 2001
Jato: The new kid on the open source block - JavaWorld March 2001
 
Can double-checked locking be fixed? - JavaWorld May 2001
Can double-checked locking be fixed? - JavaWorld May 2001
 
Talking Java! - JavaWorld August 2001
Talking Java! - JavaWorld August 2001
 
Java is here to stay (JavaWorld / January 2000 / by John Rommel)
Java is here to stay (JavaWorld / January 2000 / by John Rommel)
 
Sort it out
Sort it out
 
good design pattern
good design pattern
 
Introducory article
Introducory article
 
Berkeley DB, Java Edition I: The Basics
The original version of Berkeley DB is written in C. This means that, up until now, if a Java programmer wanted to use Berkeley DB, she would have to use some sort of translation layer (for example, JNI) to handle the communication between Java and Berkel
 
Advanced Synchronization in Java Threads
In this chapter, we look at some of the more advanced issues related to data synchronization--specifically, timing issues related to data synchronization. When you write a Java program that makes use of several threads, issues related to data synchronizat
 
Gain SQL SELECT functionality in Java
Gain SQL SELECT functionality in Java Summary In "Filter Collections," David Rappoport described a simple way to filter collections of objects. In this article, he expands on this idea and shows you how to treat an array or a collection of objects the s
 
Commons Transaction
Commons Transaction aims at providing lightweight, standardized, well tested and efficient implementations of utility classes commonly used in transactional Java programming. Initially there are implementations for multi level locks,
 
Definition of Bioinformatics
Definition of Bioinformatics Definition of Bioinformatics About Bioinformatics In February 2001, the human genome was finally deciphered! In other words, scientists have succeeded in reading the chain of more than 3 billion base pairs that
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.