How can we help?

You can also find more resources in our Help Center.

Study sets matching "algorithms"

Study sets
Classes
Users

Study sets matching "algorithms"

5 terms
Algorithms
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 t…
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…
88 terms
Algorithms
Isolate the lowest bit that is 1 in x
Replace the lowest bit that is 1 with 0
Right propagate the rightmost set bit…
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)
57 terms
Algorithms
%
return
if
r
//complete greatest... //common divisor... public static int gcd(in…
//complete greatest... //common divisor... public static int gcd(in…
//complete greatest... //common divisor... public static int gcd(in…
//complete greatest... //common divisor... public static int gcd(in…
%
//complete greatest... //common divisor... public static int gcd(in…
return
//complete greatest... //common divisor... public static int gcd(in…
40 terms
Algorithms
What is an algorithm?
What is asymptotic notation?
Briefly describe and give an example o…
List the 3 methods of resolving recurr…
Series of steps that take inputs and translates them to outpu…
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 outpu…
What is asymptotic notation?
Describes growth. Tells about the runtime of an algorithm.
43 terms
Algorithms
Selection sort
Insertion sort
Shellsort
Mergesort
Find smallest, put at beginning... Best: O(n^2)... Avg: O(n^2)... Wors…
Side-by-side comparison... Best: O(n)... Avg: O(n^2)... Worst: O(n^2)
Insertion sort over a gap... Best: O(n log n)... Avg: depends on ga…
split into sub-arrays... Best: O(n log n)... Avg: O(n log n)... Worst:…
Selection sort
Find smallest, put at beginning... Best: O(n^2)... Avg: O(n^2)... Wors…
Insertion sort
Side-by-side comparison... Best: O(n)... Avg: O(n^2)... Worst: O(n^2)
28 terms
Algorithms
Selection sort
Binary search
Sequential search
Bubble sort
For all but last element traverse to get largest element... plac…
For sorted element set... Divide in half... Compare if term is grea…
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... plac…
Binary search
For sorted element set... Divide in half... Compare if term is grea…
37 terms
Algorithms
Greedy Algorithm
Divide and Conquer
Recursive Algorithms
Dynamic Programming
an algorithm that follows problem solving heuristic of making…
works by recursively breaking down a problem into two or more…
solve a problem by solving smaller internal instances of a pr…
Break down a problem into smaller and smaller subproblems. At…
Greedy Algorithm
an algorithm that follows problem solving heuristic of making…
Divide and Conquer
works by recursively breaking down a problem into two or more…
11 terms
Algorithms
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…
1. Use one of the sorting algorithms (quick sort or bubble so…
1. Take the items in the order given ... 2. Place each item in t…
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…
10 terms
Algorithms
Build heap upper bound
Heap find max upper bound
Heap increase key upper bound
Heap extract max upper bound
O(n)
O(1)
O(log(n))
O(log(n))
Build heap upper bound
O(n)
Heap find max upper bound
O(1)
10 terms
Algorithms
Heapsort
Quicksort
Mergesort
Binary search
Sort in O(1) space, O(nlgn) time.
Sort in O(nlgn) time average case, or O(n**2) worse case
Sort in O(nlgn) time, O(n) space
Search sorted list in O(lgn) time
Heapsort
Sort in O(1) space, O(nlgn) time.
Quicksort
Sort in O(nlgn) time average case, or O(n**2) worse case
14 terms
Algorithms
Linked List
Stack
Queue
Binary Tree
Head & Tail. Single linked looks forward only. Doubly linked…
LiFo (Last in, first out). Items are "pushed" onto the stack…
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…
Stack
LiFo (Last in, first out). Items are "pushed" onto the stack…
242 terms
Algorithms
The heart of any algorithm is an
The primary tool to distinguish correc…
Proof
Idea
...
...
The heart of any algorithm is an
Idea
The primary tool to distinguish correc…
...
16 terms
Algorithms
Advanced Encryption Standard (AES) Alg…
Message Digiest 5 (MD5)
Elliptic Curve Diffie-Hellman Eohemera…
Bowfish
Symmetric Algorithm
Hashing Algorithm
Asymmetric Algorithm`
Symmetric Algorithm
Advanced Encryption Standard (AES) Alg…
Symmetric Algorithm
Message Digiest 5 (MD5)
Hashing Algorithm
8 terms
Algorithms
Algorithm
Pseudo Code
Flow chart
Linear Search
Step by step process to solve a problem
Resembles a programming language without any syntax
Diagram that represents an algorithm showing the steps as sha…
Starts at one end of data, works through checking each item i…
Algorithm
Step by step process to solve a problem
Pseudo Code
Resembles a programming language without any syntax
16 terms
Algorithms
to advance
to pull out
to cast down
bullet-proof
posuwać się naprzód
wyciągać, wycofywać
rzucić (na ziemię)
kuloodporny
to advance
posuwać się naprzód
to pull out
wyciągać, wycofywać
88 terms
Algorithms
Isolate the lowest bit that is 1 in x
Replace the lowest bit that is 1 with 0
Right propagate the rightmost set bit…
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)
88 terms
Algorithms
Isolate the lowest bit that is 1 in x
Replace the lowest bit that is 1 with 0
Right propagate the rightmost set bit…
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)
17 terms
Algorithms
Merge Sort: worst, average, best effic…
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 st…
Stable (equal elements retain their original relationship).... C…
TBD. Note O(n) additional memory is needed
Hybrid: use e.g. InsertionSort when segments get small enough…
Merge Sort: worst, average, best effic…
O(n log n) b/c it always divides a segment in half at each st…
Merge Sort: attributes
Stable (equal elements retain their original relationship).... C…
12 terms
Algorithms
Define an Algorithm:... What are the 3 w…
Parameter Passing:
Data Structure:... Arrays:
Data Structure:... Records:
A set of instructions to perform a specific task.... 1) Flow ch…
Module is self contained piece of code.... Parameters are essen…
Arrays: Can only hold data of the same data type, and data is…
A record is a set of data items all related to a single entit…
Define an Algorithm:... What are the 3 w…
A set of instructions to perform a specific task.... 1) Flow ch…
Parameter Passing:
Module is self contained piece of code.... Parameters are essen…
9 terms
Algorithms
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…
1. choose the item at mid-point to be first pivot.... 2. write d…
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…
Quick Sort Algorithm
1. choose the item at mid-point to be first pivot.... 2. write d…
18 terms
Algorithms
Algorithm
Sequence
Sub tasks
Iteration
A step-by-step procedure for solving problems
The order in which tasks are carried out
Small steps making up a larger task
When a task is repeated until there is a required outcome
Algorithm
A step-by-step procedure for solving problems
Sequence
The order in which tasks are carried out
70 terms
Algorithms
Gale-Shapley Runtime
Breadth-first search Runtime
Depth-first search Runtime
Dijkstra's Algorithm Runtime
n^2
m+n ; uses queue
m+n ; uses stack; cannot be used for finding shortest path!
Time: O(|E| |V|log|V|)
Gale-Shapley Runtime
n^2
Breadth-first search Runtime
m+n ; uses queue
47 terms
Algorithms
ALERT1
ALERT2
ALERT3
BLDGCOL
1CE... 1CR
2EN... 1CE... 1CR... 1TK... 1RU... 1HZ... 1BC
2EN... 1CE... 1CR... 1TK... 1RU... 1HZ... 1BC
2EN... 1UE... 1TK... 1RU... 1US... 1HZ... 1BC
ALERT1
1CE... 1CR
ALERT2
2EN... 1CE... 1CR... 1TK... 1RU... 1HZ... 1BC
35 terms
Algorithms
f= θ(g)
f=Ο(g)
f= Ω(g)
Divide and conquer
f= O(g) and f= Ω(g)
f(n) <= c*g(n)
g=O(f)
Split problem into smaller instance of same problem... Combine t…
f= θ(g)
f= O(g) and f= Ω(g)
f=Ο(g)
f(n) <= c*g(n)
70 terms
Algorithms
Gale-Shapley Runtime
Breadth-first search Runtime
Depth-first search Runtime
Dijkstra's Algorithm Runtime
n^2
m+n ; uses queue
m+n ; uses stack; cannot be used for finding shortest path!
Time: O(|E| |V|log|V|)
Gale-Shapley Runtime
n^2
Breadth-first search Runtime
m+n ; uses queue
10 terms
Algorithms
Sort in O(1) space, O(nlgn) time.
Sort in O(nlgn) time average case, or…
Sort in O(nlgn) time, O(n) space
Search sorted list in O(lgn) time
Heapsort
Quicksort
Mergesort
Binary search
Sort in O(1) space, O(nlgn) time.
Heapsort
Sort in O(nlgn) time average case, or…
Quicksort
19 terms
Algorithms
binary search
binary search pseudocode
running time of binary search
rate of growth
searches an ordered array for a target value by using the mid…
1. Let min = 1 and max = ... n... 2. Guess the average of max and m…
max possible steps =( base-2 logarithm of n) +1... n= length of…
how fast does the running time of the algorithm grow with the…
binary search
searches an ordered array for a target value by using the mid…
binary search pseudocode
1. Let min = 1 and max = ... n... 2. Guess the average of max and m…
10 terms
Algorithms
What is an algorithm?
What are the three algorithm constructs?
An algorithm needs to represent the a…
An algorithm needs to represent a situ…
Step by step instructions used to solve a specific problem
Sequence, Selection and Iteration
Selection
Iteration
What is an algorithm?
Step by step instructions used to solve a specific problem
What are the three algorithm constructs?
Sequence, Selection and Iteration
94 terms
Algorithms
Gale-Shapley Stable Matchings
Algorithms
What are the properties of Asymptotic…
What are common runtimes for algorithms?
Whichever gender proposes is the one that gets worse and wors…
A set of instructions
Transitivity - if f = O(g) and g = O(h), then f = O(h) (same…
linear: computing the maximum, merging two sorted lists... nlog…
Gale-Shapley Stable Matchings
Whichever gender proposes is the one that gets worse and wors…
Algorithms
A set of instructions
15 terms
Algorithms
What is an Algorithm?
What is a Data Structure?
What is a sorting algorithm?
What is Asymptotic Behavior?
A step-by-step procedure for solving a specific problem.
A method for storing data so that information can be accessed…
...
An abstract analysis of how much faster or slower an algorith…
What is an Algorithm?
A step-by-step procedure for solving a specific problem.
What is a Data Structure?
A method for storing data so that information can be accessed…
5 terms
Algorithms
algorithm
iterative algorithm
decision making algorithm
sequential algorithm
a process or set of rules to be followed in calculations or o…
a type of algorithm which repeats a series or steps over and…
a type of algorithm which is forced to make one or more decis…
a type of algorithm which follows a logical order or sequence.
algorithm
a process or set of rules to be followed in calculations or o…
iterative algorithm
a type of algorithm which repeats a series or steps over and…
6 terms
Algorithms
MergeSort and runtime
Mergesort algorithm
Binary Search
DFS + explore
Merge sort... mergesort both halves of the array recursively... unt…
Have an array of n elements... function mergesort (a[1.....n])…
Go to the middle of the array and compare the key with that o…
Explore:... put in the graph G and the vertex v in the method... pr…
MergeSort and runtime
Merge sort... mergesort both halves of the array recursively... unt…
Mergesort algorithm
Have an array of n elements... function mergesort (a[1.....n])…
19 terms
ALGORITHMS
Boast
Bow
Arrows
Cupid
Se vanter
Un arc
Flèche
Cupidon
Boast
Se vanter
Bow
Un arc
8 terms
Algorithms
Find Strongly Connected Component
Disjoint Set
Dijkstra's
Prim and Kruskal Algorithms
- A graph is said to be strongly connected if every vertex is…
Union by rank and path compression:... Three functions:... makeSet(…
Finds shortest distances to all nodes... time: O(|E| + |V| log…
finds minimum spanning tree (MST) ... MSTs are spanning trees o…
Find Strongly Connected Component
- A graph is said to be strongly connected if every vertex is…
Disjoint Set
Union by rank and path compression:... Three functions:... makeSet(…
14 terms
Algorithms
Definition of big O
Definition of theta
Definition of omega
logb (b^a) =
f: ∃ c, n0 > 0 ∀n >= n0, 0 < = f(n) < = c*g(n)
f: ∃ c1, c2, n0 > 0 ∀n >= n0, 0 < =c1 g(n) < = f(n) < = c2 c2*g…
f: ∃ c, n0 > 0 ∀n >= n0, 0 < = c*g(n)< = f(n)
a
Definition of big O
f: ∃ c, n0 > 0 ∀n >= n0, 0 < = f(n) < = c*g(n)
Definition of theta
f: ∃ c1, c2, n0 > 0 ∀n >= n0, 0 < =c1 g(n) < = f(n) < = c2 c2*g…
34 terms
ALgorithms
Adjacency matrix:... Checking if (u, v )…
Breadth First Search
Let G be an undirected graph on n node…
what's an undirecte graph
Adjacency matrix and Adjacency list differences... Conclusion:…
BFS intuition: Explore outward from s in all possible directi…
1 G is connected.... 2 G does not contain a cycle.... 3 G has n − 1…
An undirected graph is a tree if it is connected and does not…
Adjacency matrix:... Checking if (u, v )…
Adjacency matrix and Adjacency list differences... Conclusion:…
Breadth First Search
BFS intuition: Explore outward from s in all possible directi…
34 terms
ALgorithms
Adjacency matrix:... Checking if (u, v )…
Breadth First Search
Let G be an undirected graph on n node…
what's an undirecte graph
Adjacency matrix and Adjacency list differences... Conclusion:…
BFS intuition: Explore outward from s in all possible directi…
1 G is connected.... 2 G does not contain a cycle.... 3 G has n − 1…
An undirected graph is a tree if it is connected and does not…
Adjacency matrix:... Checking if (u, v )…
Adjacency matrix and Adjacency list differences... Conclusion:…
Breadth First Search
BFS intuition: Explore outward from s in all possible directi…
17 terms
Algorithms
Breadth-First Search
Depth-First Search
Bellman-Ford
Johnson's Algorithm
O(|V| + |E|)
O(|V| +|E|)
O(|V||E|) V iterations. In each we relax every edge.
O(|V||E|log|V|)
Breadth-First Search
O(|V| + |E|)
Depth-First Search
O(|V| +|E|)
19 terms
algorithms
community acquired pneumonia (cap) - o…
strep throat dx
Alveolar-arterial gradient (A-a gradie…
pulmonary embolism
CURB-65... confusion... BUN >/= 20... RR >/= 30... SBP <90, DBP <60... age >…
centor criteria... 1. fever... 2. tonsillar exudate ... 3. anterior ce…
normal 5-15 mmHg... A-a = PAo2 - Pao2... PAo2 = [713 mmHg x 21% -…
wells' criteria... 1. sxs of DVT (3 pts)... 2. no other dx more lik…
community acquired pneumonia (cap) - o…
CURB-65... confusion... BUN >/= 20... RR >/= 30... SBP <90, DBP <60... age >…
strep throat dx
centor criteria... 1. fever... 2. tonsillar exudate ... 3. anterior ce…
9 terms
Algorithms
Bellman-Ford
Kruskal's
Bogo Sort
Insertion Sort
Shortest path that allows negative edge values. For V-1 itera…
Minimum spanning tree. Build using smallest edges and connect…
Randomize array until everything is sorted
Generate a running sorted list. Insert new number where it be…
Bellman-Ford
Shortest path that allows negative edge values. For V-1 itera…
Kruskal's
Minimum spanning tree. Build using smallest edges and connect…
27 terms
Algorithms
Loop Invariant
problem instance
correctness
Monotonicity
a property/logical assertion that holds before and after each…
the input needed to compute a solution (example: an input seq…
an algorithm is correct if for all input instances, it halts…
- monotonically increasing: m <= n => f(m) <= f(n)... - monotoni…
Loop Invariant
a property/logical assertion that holds before and after each…
problem instance
the input needed to compute a solution (example: an input seq…
11 terms
Algorithms
Analysis of Algorithms
Searching and Sorting
Greedy Algorithms
Dynamic Programming
Asymptotic Analysis, Worst, Average and Best Cases, Asymptoti…
Binary Search, Selection Sort, Bubble Sort, Insertion Sort, M…
Activity Selection Problem, Kruskal's Minimum Spanning Tree A…
Overlapping Subproblems Property, Optimal Substructure Proper…
Analysis of Algorithms
Asymptotic Analysis, Worst, Average and Best Cases, Asymptoti…
Searching and Sorting
Binary Search, Selection Sort, Bubble Sort, Insertion Sort, M…
16 terms
Algorithms
Quicksort algorithm
Quicksort complexity
Mergesort algorithm
Mergesort complexity
1. choose pivot... 2. split list into greater and lesser... 3. recu…
avg: theta(n log n)... worst: O(n^2)
1. split input into lists of length 1... 2. repeatedly merge sub…
O(n log n)
Quicksort algorithm
1. choose pivot... 2. split list into greater and lesser... 3. recu…
Quicksort complexity
avg: theta(n log n)... worst: O(n^2)
12 terms
Algorithms
Algorithm
In CS algorithms must have features such
steps to develop program
Types of Algorithms
steps for solving a given problem
1. it must have input... 2. it must give at least one output... 3.…
1.Reuirements Specification (input and output)... 2.Design (تحدي…
1. Searching Algorithms... 2.Sorting Algorithms... 3. Compression A…
Algorithm
steps for solving a given problem
In CS algorithms must have features such
1. it must have input... 2. it must give at least one output... 3.…
5 terms
Algorithms
Boast
Bow
Arrows
Cupid
Se vanter
Un arc
Flèches
Cupidon
Boast
Se vanter
Bow
Un arc
43 terms
Algorithms
worst case of every comparison based s…
best case of k consecutive AddLasts
worst case of selection sort
average case of selection sort
Ω(n log(n))
Ɵ(k)
quadratic
quadratic
worst case of every comparison based s…
Ω(n log(n))
best case of k consecutive AddLasts
Ɵ(k)
15 terms
Algorithms
Algorithm
Diamond-Shaped Boxes
Efficiency (of an Algorithm)
Flow Diagram
A finite sequence of instructions for solving a problem.
Used for questions which then determine future actions.
A measure of the "run-time" of the algorithm.
A pictorial representation of an algorithm.
Algorithm
A finite sequence of instructions for solving a problem.
Diamond-Shaped Boxes
Used for questions which then determine future actions.
7 terms
Algorithms
worst case
asymptotic analysis
fast algorithm
linear time algorithm
dont care about where the input array n is coming from. Worst…
focus on when input sizes are very VERY BIG... suppress constant…
worst case running time grows slowly with large input size
number of instructions grows proportional to input size
worst case
dont care about where the input array n is coming from. Worst…
asymptotic analysis
focus on when input sizes are very VERY BIG... suppress constant…
17 terms
Algorithms
Algorithm
Low level programming language
High level programming language
Every algorithm can be constructed usi…
A precise sequence of instructions for processes that can be…
A programming language that captures only the most primitive…
A programming language with many commands and features design…
Sequencing, selection, and iteration
Algorithm
A precise sequence of instructions for processes that can be…
Low level programming language
A programming language that captures only the most primitive…
5 terms
Algorithms
MD5
SHA-1
SHA-2
HMAC-MD5
Hashing-Integrity... Creates 128-bit hashes
Hashing-Integrity... Creates 160-bit hashes
Hashing-Integrity... Creates 224-, 256-, 384, or 512-bit hashes
Integrity/Authenticity... Creates 128-bit hashes
MD5
Hashing-Integrity... Creates 128-bit hashes
SHA-1
Hashing-Integrity... Creates 160-bit hashes
1 of 10