Preview

Different Types of Sorting Schemes

Good Essays
Open Document
Open Document
1473 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Different Types of Sorting Schemes
A. Seven (7) Sorting Schemes:

1. Bubble Sort 2. Selection Sort 3. Insertion Sort 4. Merge Sort 5. Quick Sort 6. Comb Sort 7. Shell Sort

B. Definition, Best-Average-Worst Case & Algorithm:

*DEFINITION*
Bubble Sort – Sometimes incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. Because it only uses comparisons to operate on elements, it is a comparison sort. Although the algorithm is simple, most other algorithms are more efficient for sorting large lists.
Selection Sort – In computer science, a selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n2) time complexity, making it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity, and also has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.
Insertion Sort – Is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heap sort, or merge sort. However, insertion sort provides several advantages: 1. Simple implementation 2. Efficient for (quite) small data sets 3. Adaptive (i.e., efficient) for data sets that are already substantially sorted: the time complexity is O(n + d), where d is the number of inversions 4. More efficient in practice than most other simple quadratic (i.e., O(n2)) algorithms such as selection sort or bubble sort; the best case (nearly sorted

You May Also Find These Documents Helpful

  • Good Essays

    Nt1420 Unit 6

    • 1145 Words
    • 5 Pages

    INSTRUCTIONS: 1. THERE ARE SIX (6) QUESTIONS IN THIS PAPER. 2. ANSWER FIVE (5) QUESTIONS ONLY. Question 1 Arrays are used when storing a large number of values. You are required to create an array named a and answer the following questions regarding array manipulation. a. Write a method fillRandom(int[] a, int min, int max), fill the array a with a random integer value. (Note: Math.random() returns a double in the range of 0.0 and 1.0, therefore it is cast to an integer number, between the minimum and maximum value). [6 marks] b. Write the Bubble sort method to sort array a into descending order. [10 marks] c. In the quicksort, an algorithm an element is chosen from the unsorted list. This element is called the…

    • 1145 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 4

    • 380 Words
    • 2 Pages

    The term ________sort_________ refers to the process of rearranging information in alphabetical, numerical, or chronological order.…

    • 380 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ECET 370 Week 5 Lab 5

    • 650 Words
    • 3 Pages

    Exercise 1: Review of the Lecture Content Create a project using the ArrayList class and the Main class provided in DocSharing. The ArrayList class contains implementations of the first three search methods explained in this week's lecture: sequential, sorted, and binary search. The Main class uses these three methods. These programs test the code discussed in the lecture. Compile the project, run it, and review the code that is given carefully.…

    • 650 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Scenerios

    • 660 Words
    • 3 Pages

    1. Judy is an older student who recently lost her job. She is attending college for the first time and is very nervous. She’s not sure if she made the right decision to attend but feels that it’s the only reasonable option she has. She is currently enrolled in a math course; she hasn’t had math for years. She is convinced that she’s not going to pass the course. She just wants someone to discuss some of her concerns regarding math, but doesn’t want to meet with the instructor. Write a referral for Judy.…

    • 660 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Ap Psychology Quiz

    • 1056 Words
    • 5 Pages

    * This a type of rendering where all objects in your scene are projected onto a 2-D plane and sorted according to their vertical and horizontal…

    • 1056 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    4) Make another copy of the data values listed in column 1 and paste those into column 3. Then sort only…

    • 622 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Info1105

    • 951 Words
    • 4 Pages

    Now if we traverse the list from head to tail, we always get a sorted list.…

    • 951 Words
    • 4 Pages
    Good Essays
  • Good Essays

    3) A description of at least two methods of sorting records and the benefits of each:…

    • 1173 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    A report on middle colonial region in prepare for a possible war with france. The middle colonies in some ways can be challenging and in others an attribute. The following are ways the different characteristics of the middle colonies will affect the possible war with france.…

    • 392 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Complexities! Good Fair Poor Searching Algorithm Data Structure Time Complexity Depth First Search (DFS) Graph of |V| vertices and |E| edges Graph of |V| vertices and |E| edges Sorted array of n elements Array - O(|E| + |V|) O(|V|) - O(|E| + |V|) O(|V|) O(log(n)) O(log(n))…

    • 990 Words
    • 18 Pages
    Good Essays
  • Better Essays

    Examples Of Sortition

    • 940 Words
    • 4 Pages

    The freedom to representation guarantees that citizens will be free to have their views represented in whatever group makes decisions about national laws or budgets. Deciding who will represent the views of the people, whether it is a group or an independent leader, often creates conflict. Elected representatives are vulnerable to corruption, bribery, and bias. Sortition, or selection by lottery, protects the legitimacy of the election process and ultimately allows for a more truthful representation of the people. Examples from history and contemporary politics have proven that sortition is a practical and impartial system of voting that should be integrated into any new society and its constitution.…

    • 940 Words
    • 4 Pages
    Better Essays
  • Powerful Essays

    sort. It was used widely in the past and still exists in some areas today. It…

    • 1412 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    The participants used a 52 deck card, a stopwatch that recorded time to nearest second, and paper and pen for recorded results.…

    • 335 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    This particular article compares traditionally certified to alternatively certified program graduates with others carrying out a carefully constructed alternatively certified program. There are some AC programs that give teachers who are lacking proper credentials a provisional status and allow them to teach while obtaining the college credits that are equivalent to standard requirements for teacher certification programs. Some states permit Arts and Sciences graduates to go through intensified but shorter programs while holding a teaching license. Studies show that there are many problems with AC programs. The AC programs graduates tend to have more problems with curriculum and experience when compared to TC program graduates.…

    • 1547 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    SAMPLE SCOPE AND LIMITATION: COMPARISON AND CONTRAST OF SORTING ALGORITHM BETWEEN VISUAL BASIC.NET AND JAVA (NETBEANS)…

    • 334 Words
    • 2 Pages
    Satisfactory Essays