ADS/ADT Abstract Data Structure/Type
Has predefined operations
Helps design efficiently
Eliminates need to calculate algorithms
Think abstractly, implement specifically
Ex. STACKS
LIFO structure (last in, first out)
o Can push, pop
Can NOT push when s
Problem Solving Techniques
Assume you have a data set
What is the problem? Searching or ordering that set of data
Does the search have to be fast? (Should be) How can we make it faster?
HERE ARE SOME TECHNIQUES (aka Search Algorithms) TO DO THIS.
Divide a
Special Topics
Solutions for other random problems that dont fall into a specific category
Strassens Algorithm (slide 5)
Reduces number of matrix multiplications necessary to multiply 2 matrices together from
8 to 7
Doesnt benefit small matrices much,
Eric Diehl
CS 420- Algorithm Analysis
Dr. Dimitoglou
Graph Traversals
Trees are graphs with a very specific structure
Graph traversals allow us to process graphs for information (degrees of separation
friends on Facebook)
o 2 types: Depth-first (stack)
CS 520 Algorithm Analysis
Dr. G. Dimitoglou
Hood College
Dept. of Computer Science
HOMEWORK #2: Suggested Solutions
1.
2. Knapsack problem
1. Calculate value ratio (value/weight) for each item
Item #
Value
Weight
Ratio
1
15
15
.1
2
9
24
2.67
3
27
14
.52
4
Eric Diehl
Lower Bound Theory
Finding the lower bound of the algorithm is much harder than finding an improved (good
enough) solution
Lower Bound Theory for a specific PROBLEM, not the algorithm in general
Trivial Lower Bounds
o Where n is the number of
Eric Diehl
MIDTERM NOTES
1.
2.
3.
Multiple Choice
T/F
Some Problem Solving/Short Answer (a sentence or a few words)
Concepts
o Characteristics of Divide and Conquer
o Greedy Method
o Dynamic Programming
o Divide and Conquer (tightly tied with recursion)
o
Dr. G. Dimitoglou
CS 520 Algorithm Analysis
Homework #3
(due: April 2, 2013)
1. (40 pts)
Implement the the DFS algorithm. Use a text file (called input.txt) that contains an adjacency matrix
to read-in data and create a directed graph to be searched. The