Algorithms 4110 Midterm

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Merge Sort

A type of divide and conquer algorithm that was incited by John von Neumann. First the list is divided into the smallest unit (1 element), then each element is compared with the adjacent list to sort and merge the two adjacent lists. Finally all elements are sorted and merged.

Merge Sort Algorithm

Breaks data into small groups, puts the groups in order, then combines groups until all are in order

iterative substitution

In the iterative substitution, or "plug-and-chug," technique, we iteratively apply the recurrence equation to itself and see if we can find a pattern

Quick Sort

Non-stable, in place sort with an order of growth of NlogN. Needs lgN of extra space. It has a probabilistic guarantee. Works by making use of a divide and conquer method. The array is divided into two parts, and then the parts are sorted independently. An arbitrary value is chosen as the partition. Afterwards, all items which are larger than this value go to the right of it, and all items which are less than this value go to the left of it. We arbitrarily choose a[lo] as a partitioning item. Then we scan from the left end of the array one by one until we find an entry that is greater than a[lo]. At the same time, we are scanning from a[lo] to the right to find an entry that is less than or equal to a[lo]. Once we find these two values, we swap them.

Quick Sort algorithm

This uses a divide and conquer algorithm. First the pivot value which is the first item in the list is selected. Then the remainder of the list is divided into two partitions, the elements less than the pivot is in the first partition and the greater elements in the second.


संबंधित स्टडी सेट्स

Foundations chapter 8 Adaptive quizzing

View Set

2.4.4 - Assessment Types (Practice Questions)

View Set

Chapter 4 Nonverbal Communication

View Set

ATI nurse logic 2.0--knowledge and clinical judgement--> advanced

View Set