GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Sorting

Nathan Hunsdale Programming 2 Masters of Science Englisch 24 Karten

Karten in diesem Stapel (24)

  1. 1Sorting algorithms The end result will always be the _____ no matter which algorithm you use to sort itsame
  2. 2Sorting Algorithms The choice of algorithm affects only the _____ and _____ _____ of the programruntime and memory use
  3. 3Sorting Algorithms Bubble sort, Selection Sort and Insertion Sort are _____ to program but _____easy but inefficient
  4. 4Sorting Algorithms Merge Sort is _____ than Selection Sort and Insertion Sort but _____ to programfaster but harder to program
  5. 5Bubble Sort The bubble sort compares _____ elements. The first and second elements are compared and then swapped if out of order and this continues the whole way down the listadjacent
  6. 6Bubble Sort The process is repeated until there are no more _____ to be made. This is when it has finishedswaps
  7. 7Bubble Sort The bubble sort keeps track of the occurring swaps by use of a _____flag
  8. 8Selection Sort _____ but _____ sorting algorithmsimple but inefficient
  9. 9Selection Sort Its first iteration selects the _____ element in the array and swaps it with the _____ elementIts first iteration selects the SMALLEST element in the array and swaps it with the FIRST element
  10. 10Selection Sort The 2nd iteration selects the _____ smallest item and swaps it with the _____ elements. This process is repeated until the list is doneThe 2nd iteration selects the 2ND smallest item and swaps it with the 2ND element
  11. 11Selection Sort Efficiency This algorithm runs in _____ time.O(n2)
  12. 12Selection Sort Efficiency Contains _____ for loops2
  13. 13Selection Sort Efficiency The outer for loop iterates over the first _____ elements in the arrayn-1
  14. 14Selection Sort Efficiency The inner for loop iterates over each item in the remaining array searching for the _____ elementsmallest
  15. 15Selection Sort Efficiency In Big O terms, smaller terms drop out and constants are ignored , leaving a final big O of _____O(n2)
  16. 16Insertion Sort Another, _____ but _____ methodsimple but inefficient
  17. 17Insertion Sort The first iteration of this algorithm takes the _____ element in the array, and if it is less than the first element, swaps the two2nd
  18. 18Insertion Sort The second iteraton looks at the _____ element and inserts it into the correct position and puts it into the correct position with respect to the elements that have already been sorted; the first 3 items are now in order. This continues3rd
  19. 19Quick Sort This is a divide and conquer algorithm. This means that the data is separated into _____ parts (divide) which are individually sorted(conquered) and then combined2
  20. 20Quick sort If the array contains only _____ element or _____ elements then the array is sorted.1 or 0
  21. 21Quick sort What is the pivot element and what is it used for?An element selected from the array which is the breaking point. If elements are smaller than the breaking point then they are put into one array and the ones that are bigger go into another.
  22. 22Quick sort The 2 arrays created from the pivot element are sorted _____recursively
  23. 23Quick sort The arrays are then _____combined
  24. 24Quick sort Quick sort can then be implemented to sort "in place". What does this mean?Sorting takes place in the array and no additional array needs to be created

Informationen

Beschreibung
Masters of Science Programming 2 Karteikarten am Sorting, erstellt von Nathan Hunsdale am 02/06/2014.
Erstellt von
Nathan Hunsdale
Aufrufe
22
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck