#### Study sets matching "algorithms"

#### Study sets matching "algorithms"

Linked List

Stack

Queue

Binary Tree

Head & Tail. Single linked looks forward only. Doubly linked l…

LiFo (Last in, first out). Items are "pushed" onto the stack a…

FiFo(First in, First out). Items are "enqueue" into queue and…

Root (or Head node) = Very top node... Leaf nodes/Terminal nodes…

Linked List

Head & Tail. Single linked looks forward only. Doubly linked l…

Stack

LiFo (Last in, first out). Items are "pushed" onto the stack a…

What is an algorithm?

What is asymptotic notation?

Briefly describe and give an example of…

List the 3 methods of resolving recurre…

Series of steps that take inputs and translates them to output…

Describes growth. Tells about the runtime of an algorithm.

f(n)=O(g(n)) : g(n) is an upperbound of f(n). ... f(n) = Ω(g(n))…

Master method, substitution, recursion tree.

What is an algorithm?

Series of steps that take inputs and translates them to output…

What is asymptotic notation?

Describes growth. Tells about the runtime of an algorithm.

Selection sort

Binary search

Sequential search

Bubble sort

For all but last element traverse to get largest element... place…

For sorted element set... Divide in half... Compare if term is great…

Loop through sorted set until item found

Traverse set... Swap adjacent items if out of order... Repeat until…

Selection sort

For all but last element traverse to get largest element... place…

Binary search

For sorted element set... Divide in half... Compare if term is great…

pseudo code

natural language

boolean condition

algorithm

is a kind of structured English for describing algorithms. It…

a language that has developed naturally in use (as contrasted…

compares two values to each other and then returns either a tr…

a set of steps; for a computer program to accomplish

pseudo code

is a kind of structured English for describing algorithms. It…

natural language

a language that has developed naturally in use (as contrasted…

%

return

if

r

//complete greatest... //common divisor... public static int gcd(int…

//complete greatest... //common divisor... public static int gcd(int…

//complete greatest... //common divisor... public static int gcd(int…

//complete greatest... //common divisor... public static int gcd(int…

%

//complete greatest... //common divisor... public static int gcd(int…

return

//complete greatest... //common divisor... public static int gcd(int…

Isolate the lowest bit that is 1 in x

Replace the lowest bit that is 1 with 0

Right propagate the rightmost set bit i…

Compute x modulo a power of 2 (y)

x & ~(x - 1)

x & (x - 1)

x | (x & ~(x - 1) - 1)

x & (y - 1)

Isolate the lowest bit that is 1 in x

x & ~(x - 1)

Replace the lowest bit that is 1 with 0

x & (x - 1)

Bubble Sort

Quick Sort

Binary Search

First-Fit

1. Write out the the numbers/names given.... 2. Record only each…

1. Write down the list... 2. Select the pivot(mid point)... 3. Now w…

1. Use one of the sorting algorithms (quick sort or bubble sor…

1. Take the items in the order given ... 2. Place each item in th…

Bubble Sort

1. Write out the the numbers/names given.... 2. Record only each…

Quick Sort

1. Write down the list... 2. Select the pivot(mid point)... 3. Now w…

Bubble Sort Algorithm

Quick Sort Algorithm

Binary Search Algorithm

Bin Packing Algorithm

1. If there is one number in the list then stop.... 2. Make one p…

1. choose the item at mid-point to be first pivot.... 2. write do…

1. Choose the item at midp-point,m.... 2. (i) if T=m then search…

1. Select each item and place in the first available bin than…

Bubble Sort Algorithm

1. If there is one number in the list then stop.... 2. Make one p…

Quick Sort Algorithm

1. choose the item at mid-point to be first pivot.... 2. write do…

Selection Sort

Bubble sort

sequential search

string brute force match

Scan array, swap lowest for first. n2 Unstable.

compare adjacent. swap if necessary. biggest floats to the top…

scan through for the key. if found return true. add they key t…

align the key against the beginning of the sentence. move thro…

Selection Sort

Scan array, swap lowest for first. n2 Unstable.

Bubble sort

compare adjacent. swap if necessary. biggest floats to the top…

Merge Sort: worst, average, best effici…

Merge Sort: attributes

Merge Sort: explanation of efficiency

Merge Sort: common improvements

O(n log n) b/c it always divides a segment in half at each ste…

Stable (equal elements retain their original relationship).... Ca…

TBD. Note O(n) additional memory is needed

Hybrid: use e.g. InsertionSort when segments get small enough…

Merge Sort: worst, average, best effici…

O(n log n) b/c it always divides a segment in half at each ste…

Merge Sort: attributes

Stable (equal elements retain their original relationship).... Ca…

Quicksort

Mergesort

Heapsort

Insertion Sort

Best: O(n log(n))... Average: O(n log(n))... Worst: O(n^2)

Best: O(n log(n))... Average: O(n log(n))... Worst: O(n log(n))

Best: O(n log(n))... Average: O(n log(n))... Worst: O(n log(n))

Best: O(n)... Average: O(n^2)... Worst: O(n^2)

Quicksort

Best: O(n log(n))... Average: O(n log(n))... Worst: O(n^2)

Mergesort

Best: O(n log(n))... Average: O(n log(n))... Worst: O(n log(n))

algorithm

Euclid's algorithm

sieve of Eratosthenes

floor function

a sequence of unambiguous instructions for solving a... problem,…

gcd(m, n) = gcd(n, m mod n)

The algorithm starts by initializing a list of prime candidate…

round down

algorithm

a sequence of unambiguous instructions for solving a... problem,…

Euclid's algorithm

gcd(m, n) = gcd(n, m mod n)

Algorithm

Input

Output

Instance of the Problem

Well defined computational procedure that takes some input and…

value or values given to an algorithm

value or values produced by an algorithm

particular input

Algorithm

Well defined computational procedure that takes some input and…

Input

value or values given to an algorithm

collection

linear collection

non-linear collection

Examples of linear collection:... A. objec…

a structured data type that stores data and provides operation…

a list of elements where one element follows the previous... elem…

hold elements that do not have positional order... within the col…

C

collection

a structured data type that stores data and provides operation…

linear collection

a list of elements where one element follows the previous... elem…

INSERTION SORT

SELECTION SORT

QUICKSORT

HEAPSORT

TIME COMPLEXITY: ... BEST: O (n) when list almost sorted... AVERAGE…

TIME COMPLEXITY:... BEST: O(n^2)... AVERAGE: O(n^2)... WORST: O(n^2)…

TIME COMPLEXITY:... BEST: O (n log n), (O(n) three way parition)…

TIME COMPLEXITY:... BEST: O (n log n)... AVERAGE: O (n log n)... WORST:…

INSERTION SORT

TIME COMPLEXITY: ... BEST: O (n) when list almost sorted... AVERAGE…

SELECTION SORT

TIME COMPLEXITY:... BEST: O(n^2)... AVERAGE: O(n^2)... WORST: O(n^2)…

what is a equivalence relation?

What is a reflexive relation?

What is a symmetric relation?

What is a transient relation?

a relation between elements of a set that is reflexive, symmet…

(a R a), for all a

(a R b) if and only if (b R a)

(a R b) and (b R c) implies (a R c)... Due to transitivity, each…

what is a equivalence relation?

a relation between elements of a set that is reflexive, symmet…

What is a reflexive relation?

(a R a), for all a

Gale-Shapley Stable Matchings

Algorithms

What are the properties of Asymptotic G…

What are common runtimes for algorithms?

Whichever gender proposes is the one that gets worse and worse…

A set of instructions

Transitivity - if f = O(g) and g = O(h), then f = O(h) (same w…

linear: computing the maximum, merging two sorted lists... nlogn…

Gale-Shapley Stable Matchings

Whichever gender proposes is the one that gets worse and worse…

Algorithms

A set of instructions

Algorithms

The application of each step of an algo…

Using a Boolean condition to determine…

The repetition of part of an algorithm…

precise sequences of instructions for processes that can be ex…

function

true/false

loop

Algorithms

precise sequences of instructions for processes that can be ex…

The application of each step of an algo…

function

Algorithm

Sequence

Selection

Iteration

items of data that are next to each other

the order in which tasks are to be carried out

a question is asked, and depending on the answer, the program…

when a task is repeated for a set number of times or until the…

Algorithm

items of data that are next to each other

Sequence

the order in which tasks are to be carried out