Algorithms

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:41 PM on 5/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

35 Terms

1
New cards

Insertion Sort

knowt flashcard image
2
New cards

LomutoPartition

knowt flashcard image
3
New cards

Hoare partition

knowt flashcard image
4
New cards

Quicksort

  • Lomuto:
    QuickSort(A, p, r - 1)
    QuickSort(A, r + 1, q)

  • Hoare:
    QuickSort(A, p, r)
    QuickSort(A, r + 1, q)

So your statement is correct: for Hoare, the first recursive call uses p, r instead of p, r - 1.

The reason is:

  • in Lomuto, r is the pivot’s final position, so exclude it

  • in Hoare, r is only the split boundary, so include it in the left side

One warning: this is true only if your Partition is actually a Hoare partition. If you use Hoare partition but still recurse with r - 1, you can skip elements or break the algorithm

<ul><li><p><strong>Lomuto:</strong><br><code>QuickSort(A, p, r - 1)</code><br><code>QuickSort(A, r + 1, q)</code></p></li><li><p><strong>Hoare:</strong><br><code>QuickSort(A, p, r)</code><br><code>QuickSort(A, r + 1, q)</code></p></li></ul><p>So your statement is correct: for Hoare, the first recursive call uses <code>p, r</code> instead of <code>p, r - 1</code>.</p><p>The reason is:</p><ul><li><p>in <strong>Lomuto</strong>, <code>r</code> is the pivot’s final position, so exclude it</p></li><li><p>in <strong>Hoare</strong>, <code>r</code> is only the split boundary, so include it in the left side</p></li></ul><p>One warning: this is true only if your <code>Partition</code> is actually a <strong>Hoare partition</strong>. If you use Hoare partition but still recurse with <code>r - 1</code>, you can skip elements or break the algorithm</p><p></p>
5
New cards

Randomized Lomuto Partition

knowt flashcard image
6
New cards

Evolved Bubble Sort

knowt flashcard image
7
New cards

Merge Sort

knowt flashcard image
8
New cards

2 Way Merge Sort

knowt flashcard image
9
New cards

Operations on Containers Time Complexity

knowt flashcard image
10
New cards

Time Complexity

Basically if you end up with small o that directly implies big O since small o is tighter and the way that you would write it is F(n) is an element of o(g(n))

<p>Basically if you end up with small o that directly implies big O since small o is tighter and the way that you would write it is F(n) is an element of o(g(n))</p>
11
New cards

Asymptotic Analysis

knowt flashcard image
12
New cards

Time Complexity Graph

knowt flashcard image
13
New cards

Masters Theorem

knowt flashcard image
14
New cards

Sorting Algorithms Complexities

knowt flashcard image
15
New cards

Max heapify

knowt flashcard image
16
New cards

Build Heap Max

knowt flashcard image
17
New cards

Heap Sort

knowt flashcard image
18
New cards

Heap Maximum

knowt flashcard image
19
New cards

Extract-Max

knowt flashcard image
20
New cards

Increase-Key(S, x, k)

knowt flashcard image
21
New cards

Insert - Key

knowt flashcard image
22
New cards

Counting Sort

knowt flashcard image
23
New cards

Summary of all Sorting

knowt flashcard image
24
New cards

Bucket Sort

knowt flashcard image
25
New cards

Radix Sort - Passing for the Counting Sort

knowt flashcard image
26
New cards

Counting Sort in Radix Sort implementation

knowt flashcard image
27
New cards

Dynamic Programming The Jumping Problem

<p></p>
28
New cards

Rod Cutting Problem

knowt flashcard image
29
New cards

Decoding Problem

knowt flashcard image
30
New cards

Coin Change Problem

 

<p></p><p>&nbsp;</p>
31
New cards

longest increasing subsequence 

knowt flashcard image
32
New cards

Counting Sort Preprocessing

knowt flashcard image
33
New cards

Greedy Template

knowt flashcard image
34
New cards

Maximum points Greedy

knowt flashcard image
35
New cards

Min points Greedy

knowt flashcard image