answersLogoWhite

0


Best Answer

If it is already sorted, the best is to leave the array as it is.

If it is already sorted, the best is to leave the array as it is.

If it is already sorted, the best is to leave the array as it is.

If it is already sorted, the best is to leave the array as it is.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

If it is already sorted, the best is to leave the array as it is.

This answer is:
User Avatar

User Avatar

Abu saleh Ponir

Lvl 2
1y ago

Container of objects of similar types

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the best sorting technique for already sorted array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the running time of heapsort on an array A of length n that is already sorted in increasing order?

The running time of HEAPSORT on an array A of length n that is already sorted in increasing order is (n lg n) because even though it is already sorted, it will be transformed back into a heap andsorted.The running time of HEAPSORT on an array A of length n that is sorted in decreasing order willbe (n lg n). This occurs because even though the heap will be built in linear time, every time themax element is removed and the HEAPIFY is called it will cover the full height of the tree


Write a program sort a list of names in alphabetical order in java programming language?

// Let's assume we're sorting the characters in String toSort // convert the String to an array of characters char[] chars = toSort.toCharArray(); // let Java do the sorting for you Arrays.sort(chars); // recreate the original String with the newly sorted array of characters toSort = new String(chars);


Sort array in ascending descending order in python?

Using sorted(array,reverse=True)


What is the worst case and average case complexity of bubblesort?

Best case: O(n) Worst case: O(n2) Let's assume we're sorting data in an array of length n. Let's also assume that we're sorting in ascending order (low-high). The worst case is that you will have the smallest value in the last space in the array. This means that it will move exactly once each pass towards the first space in the array. It will take n-1 passes to do this, doing n comparisons on each pass: O(n2) The best case is that the data comes to us already sorted. Assuming that you have a smart implementation (which you should, because it's easy) which stops itself once a pass makes no changes, then we only need to do n comparisons over a single pass: O(n)


What is useful to implement quick sort?

Knowledge and experience.

Related questions

What is the different sorting algorithms for arrays in java?

The built in array sorting algorithm (java.util.Arrays.sort) depends on the type of data being sorted. Primitive types are sorted with a modified implementation of quicksort. Objects are sorted with a modified implementation of mergesort.


What is the running time of heapsort on an array A of length n that is already sorted in increasing order?

The running time of HEAPSORT on an array A of length n that is already sorted in increasing order is (n lg n) because even though it is already sorted, it will be transformed back into a heap andsorted.The running time of HEAPSORT on an array A of length n that is sorted in decreasing order willbe (n lg n). This occurs because even though the heap will be built in linear time, every time themax element is removed and the HEAPIFY is called it will cover the full height of the tree


Is an array that is in sorted order a min heap?

Yes, an array that is in sorted order is considered a min-heap because the smallest item in the array is the root. Also, the rest of the items in the array will gradually get bigger from the root until the end of the array.


Write a program sort a list of names in alphabetical order in java programming language?

// Let's assume we're sorting the characters in String toSort // convert the String to an array of characters char[] chars = toSort.toCharArray(); // let Java do the sorting for you Arrays.sort(chars); // recreate the original String with the newly sorted array of characters toSort = new String(chars);


What are the Application of quick sort?

Sorting an array.


Sort array in ascending descending order in python?

Using sorted(array,reverse=True)


Sorting of array through function in java programming?

// the build in sorting functions in Java will sort pretty much any array // of Comparable objects or primitives Arrays.sort(someArray);


What is a example of a array?

An ordered array is simply an array where all elements are in sorted order: int a[] = {3, 6, 9, 10, 15, 21}; // ordered array An array can either be initialised with ordered elements or the elements may be sorted after initialisation. When inserting new elements into an ordered array, the order must be maintained.


What is the worst case and average case complexity of bubblesort?

Best case: O(n) Worst case: O(n2) Let's assume we're sorting data in an array of length n. Let's also assume that we're sorting in ascending order (low-high). The worst case is that you will have the smallest value in the last space in the array. This means that it will move exactly once each pass towards the first space in the array. It will take n-1 passes to do this, doing n comparisons on each pass: O(n2) The best case is that the data comes to us already sorted. Assuming that you have a smart implementation (which you should, because it's easy) which stops itself once a pass makes no changes, then we only need to do n comparisons over a single pass: O(n)


What is useful to implement quick sort?

Knowledge and experience.


Sorting an array of numbers in java?

here you will a good example on java sorting algorithm application http://javacodespot.blogspot.com/2010/08/java-sorting-animations.html http://javacodespot.blogspot.com/


What is internal and external sorting techniques?

Internal sorting it means we are arranging the number within the array only which is in computer primary memory. External sorting it is the sorting of numbers from the external file by reading it from secondary memory.