Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


phani
linear sorting
1 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners


what is linear sorting? can any send me an example


Advertisement
View Answers

January 14, 2011 at 6:03 PM


Hi Friend,

Try this:

import java.util.*;
class ArraySort{
    public static void sortArray(int arr[]){
    Arrays.sort(arr);
    System.out.println("After Sorting: ");
    for(int i=0;i<arr.length;i++){
    System.out.println(arr[i]);
    }
    }

    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter Array Elements: ");
        int array[]=new int[5];
        for(int i=0;i<array.length;i++){
            array[i]=input.nextInt();
        }
        sortArray(array);

    }
}

Thanks



Related Tutorials/Questions & Answers:
linear sorting
linear sorting  what is linear sorting? can any send me an example   Hi Friend, Try this: import java.util.*; class ArraySort{ public...("After Sorting: "); for(int i=0;i<arr.length;i++){ System.out.println
linear search
linear search  write a program to find string using linear search
Advertisements
Linear hashing
Linear hashing   hello,, What is linear hashing?   hii, In linear hashing, the table is gradually expanded by splitting the buckets in order until the table has doubled its size
Linear Regression
Linear Regression  hi........ Can u give me a simple code for Linear Regression in java swings????????? thanks in advance plz reply
sorting
sorting   write a program to arrange sorting in rows,column and diagonal
Sorting
Sorting  can any help me know which sorting algorithm java uses for sorting collection and arrays
sorting
sorting  write to a program to arrange the sorting in rows, column and digonal
sorting
sorting  how to do sorting without using bubble sort,selection sort
linear search - Java Beginners
linear search  How do i use a linear search for a 2 dimensional hard coded array? I need to check the first 2 letters in an item number and if it's not in the list i need to show an error message to the user.  Hi
Linear and Non-Linear Data Structure in C
Linear Data Structure: Linear data structure is linear if element is adjacent... as its previous and next member. Example of Linear Data Structure Array Linked List Stack Queue Non- Linear Data Structure Non-Linear data
Sorting in Java
Sorting in Java  Sorting in Java
Linear search in java
Linear search in java In this section we will  know, what is linear search and how linear works. Linear search is also known as "sequential.... Linear search is a searching mechanism which search  key element
group by sorting
group by sorting  group by sorting of data in SQL
sorting numbers
sorting numbers  How to sort the numbers in ascending order   import java.util.*; class SortNumbers{ public static void main(String[] args) { Scanner input=new Scanner(System.in
Sorting Program
Sorting Program  To sort 10items in alphabetical order   Arrays.sort(name of ur array)   import java.util.*; class ArrayExample{ public static void main(String[] args) { String array[]=new
What is Linear Tape Open(LTO)
and application of data. LTO or Linear Tape Open is one of the most promising storage... for data sharing. LTO or Linear Tape Open is the storage technology that addresses all...) and Quantum's DLT (Digital Linear Tape). Other big brands in the storage market were
Linear Search in Java
Linear Search in Java In this section, we are going to find an element from an array using Linear Searching. Linear searching is a good way to find an element from the array. The array can be of any order, it checks whether a certain
Java sorting
sorting mechanism. say about Collections.Sort() & Arrays.Sort() that uses
sorting and storing data
sorting and storing data   sorting and storing data in UITableView
Sorting and Searching
Sorting and Searching  Hi i would really be thankful if someone could help me with this A program is required to ask users to rate the Java programming language using a number in the range 0 - 10. The data input is ended
Sorting an ArrayList
Sorting an ArrayList  print("code sample");Hello All, I am working on a program for school and I am having trouble with sorting my list. The numbers I receive in my output are correct, but not in ascending order as required
Sorting the array
Sorting the array  Implement a program to process votes for 5 candidates in a talent contest. The program should use a String array to hold the names of the 5 candidates and an integer array to record the number of votes for each
Bubble Sorting in Java
Bubble Sorting in Java  Hi, What is Bubble Sorting? Guide me where to learn Bubble Sorting in Java? Thanks   Hi, Check the tutorial at Bubble Sorting in Java. Thanks
sorting Line in c
sorting Line in c  Hi I need help with sorting line in programming c asking user to enter 1-10 characters and then sort them in lower case, alphabetical and ascending order. Any help will be appreciated! please help! void
Imp-HTML Table Sorting
Imp-HTML Table Sorting   Hi, I am working on a project and as per requirement from client i have to sort a table based on the ID Column. I want... of HTML table sorting where sorting happenes whenever user clicks on column header
Sorting along life span
Sorting along life span  how to find total age in date of birth and date of death.and also sort along life span.using object class and collection API
What are the different functions in sorting an array?
What are the different functions in sorting an array?  What are the different functions in sorting an array
sorting array in java
sorting array in java  How to sort array in Java or JavaScript?   JavaScript Sorting array tutorial   Java Sort array of strings import java.util.*; class ArrayExample{ public static void main(String
 

 

 

DMCA.com