public class MergeSort{ public static void main(String a[]){ int i; int array[] = {12,9,4,99,120,1,3,10}; System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++) System.out.print( array[i]+" "); System.out.println(); mergeSort_srt(array,0, array.length-1); System.out.print("Values after the sort:\n"); for(i = 0; i <array.length; i++) System.out.print(array[i]+" "); System.out.println(); }
public static void mergeSort_srt(int array[],int lo, int n){ int low = lo; int high = n; if (low >= high) { return; }
int middle = (low + high) / 2; mergeSort_srt(array, low, middle); mergeSort_srt(array, middle + 1, high); int end_low = middle; int start_high = middle + 1; while ((lo <= end_low) && (start_high <= high)) { if (array[low] < array[start_high]) { low++; } else { int Temp = array[start_high]; for (int k = start_high- 1; k >= low; k--) { array[k+1] = array[k]; } array[low] = Temp; low++; end_low++; start_high++; } } } }
corejava - Java Beginners corejava pass by value semantics Example of pass by value semantics in Core Java. Hi friend,Java passes parameters to methods using pass by value semantics. That is, a copy of the value of each of the specified
JList
JList pls tell me about the concept the JList in corejava? and tell me a suitable example
core java - Java Beginners
core java how to create a login page using only corejava(not servlets,jsp,hibernate,springs,structs)and that created loginpage contains database(ms-access) the database contains data what ever u r enter and automatically date
Eclipse - IDE Questions
Eclipse Hi To All..
I am new to ECLIPSE IDE. Please suggest me any book which can give me complete idea of setting environment and development with basic to advance development of java like(corejava,servlet,jsp,struts,ejb
HOW TO BECOME A GOOD PROGRAMMER
HOW TO BECOME A GOOD PROGRAMMER I want to know how to become good programmer
Hi Friend,
Please go through the following link:
CoreJava Tutorials
Here you will get lot of examples with illustration where you can
how to count words in string using java
how to count words in string using java how to count words in string using corejava
Hi Friend,
Try the following code:
import java.util.*;
class CountWords{
public static void main(String[] args
Factorial Program in Java
");
}
}
}
Output
C:\Documents and Settings\bharat\Desktop\bipul\CoreJava\Swing Example...\bipul\CoreJava\Swing Example\Factorial>
java Factorial1
enter
Mutliple files upload
;
if (skilltype == "Java") {
list = new Array("CoreJava","J2EE","J2SE...");
listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP
Mutliple files upload
;
if (skilltype == "Java") {
list = new Array("CoreJava","J2EE","J2SE...");
listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP
Mutliple files upload
;
if (skilltype == "Java") {
list = new Array("CoreJava","J2EE","J2SE...");
listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP
Mutliple files upload
;
if (skilltype == "Java") {
list = new Array("CoreJava","J2EE","J2SE...");
listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP
Mutliple files upload
== "Java") {
list = new Array("CoreJava","J2EE","J2SE...");
listValue = new Array("CoreJava","J2EE","J2SE","Struts","Hibernet","Springs","JSP