Name:
CSE373 Fall 2013, Final Examination
December 10, 2013
Please do not turn the page until the bell rings.
Rules:
The exam is closed-book, closed-note, closed calculator, closed electronics.
Please stop promptly at 4:20.
There are 114 points total,
Name: _ Email address: _
CSE 373 Sample Final Exam
(closed book, closed notes, calculators o.k.)
Instructions Read the directions for each question carefully before answering. We may give partial credit based on the work you write down, so if time permits
Name: _
Email address: _
CSE 373 Sample Final Exam
(closed book, closed notes, calculators o.k.)
Instructions Read the directions for each question carefully before answering. We may
give partial credit based on the work you write down, so if time permits
PHYSICS
LECTURE NOTES
PHYS 395
ELECTRONICS
c D.M. Gingrich
University of Alberta
Department of Physics
1999
Preface
Electronics is one of the fastest expanding elds in research, application development and
commercialization. Substantial growth in the eld
CSE373: Data Structures & Algorithms
Optional Slides: AVL Delete
Dan Grossman
Fall 2013
The AVL Tree Data Structure
Structural properties
1. Binary tree property
2. Balance property:
balance of every node is
between -1 and 1
Result:
Worst-case depth is
O(
CSE373: Data Structures and Algorithms
Lecture 1: Introduction; ADTs; Stacks/Queues
Dan Grossman
Fall 2013
Welcome!
We have 10 weeks to learn fundamental data structures and
algorithms for organizing and processing information
Classic data structures / a
CSE373: Data Structures & Algorithms
Lecture 4: Dictionaries; Binary Search Trees
Dan Grossman
Fall 2013
Where we are
Studying the absolutely essential ADTs of computer science and
classic data structures for implementing them
ADTs so far:
1.
2.
Stack:
Qu
CSE373: Data Structures & Algorithms
Lecture 5: AVL Trees
Dan Grossman
Fall 2013
The AVL Tree Data Structure
Structural properties
1. Binary tree property
2. Balance property:
balance of every node is
between -1 and 1
Result:
Worst-case depth is
O(log n)
CSE373: Data Structures and Algorithms
Lecture 3: Asymptotic Analysis
Dan Grossman
Fall 2013
Gauging performance
Uh, why not just run the program and time it
Too much variability, not reliable or portable:
Hardware: processor(s), memory, etc.
OS, Java ve
CSE373: Data Structures and Algorithms
Lecture 2: Math Review; Algorithm Analysis
Dan Grossman
Fall 2013
Today
Finish discussing stacks and queues
Review math essential to algorithm analysis
Proof by induction
Powers of 2
Binary numbers
Exponents and
Lecture 12: Introduction to Graphs
CSE 373
Edition 2016
Graphs
A graph is a formalism for representing relationships among items
Very general definition because very general concept
A graph is a pair
G = (V,E)
Han
A set of vertices, also known as node
Lecture 6: AVL Trees
CSE 373
Edition 2016
Insert: detect potential imbalance
1. Insert the new node as in a BST (a new leaf)
2. For each node on the path from the root to the new leaf, the
insertion may (or may not) have changed the nodes height
3. So aft
Lecture 7: Priority Queues
CSE 373
Edition 2016
A new ADT: Priority Queue
A priority queue holds compare-able data
Like dictionaries and unlike stacks and queues, need to
compare items
Given x and y, is x less than, equal to, or greater than y
Meaning
Lecture 2: Asymptotic Analysis
CSE 373
Edition 2016
Efficiency
What does it mean for an algorithm to be efficient?
We primarily care about time (and sometimes space)
Is the following a good definition?
An algorithm is efficient if, when implemented, i
Lecture 5: Binary Search Trees (continued)
CSE 373
Edition 2016
1
More on traversals
void inOrderTraversal(Node t)cfw_
if(t != null) cfw_
inOrderTraversal(t.left);
process(t.element);
inOrderTraversal(t.right);
Sometimes order doesnt matter
Example: su
Lecture 4: Dictionaries; Binary Trees
CSE 373
Edition 2016
Where we are
Studying the absolutely essential ADTs of computer science and
classic data structures for implementing them
ADTs so far:
1. Stack:
2. Queue:
push, pop, isEmpty,
enqueue, dequeue, is
Lecture 9: Implementing Union-Find
CSE 373
Edition 2016
Topics
Last lecture:
What are disjoint sets
And how are they the same thing as equivalence relations
The union-find ADT for disjoint sets
Now:
Applications of union-find
Basic implementation of
CSE373: Data Structures & Algorithms
Lecture 6: Priority Queues
Dan Grossman
Fall 2013
A new ADT: Priority Queue
Textbook Chapter 6
Nice to see a new and surprising data structure
A priority queue holds compare-able data
Like dictionaries and unlike sta
Disclaimer: Do not use for official
advising purposes !
Topological Sort
Problem: Given a DAG G=(V,E), output all vertices in an order such
that no vertex appears before another vertex that has an edge to it
Example input:
CSE373: Data Structures & Algori
Name: _
Email address: _
CSE 373 Winter 2012: Midterm #1
(closed book, closed notes, NO calculators allowed)
Instructions: Read the directions for each question carefully before answering. We may give
partial credit based on the work you write down, so if
Motivation
Essential: knowing available data structures and their trade-offs
Youre taking a whole course on it! -
CSE373: Data Structures & Algorithms
Lecture 16: Software-Design Interlude
Preserving Abstractions
However, you will rarely if ever re-impl
Name:
CSE373 Fall 2013, Final Examination
December 10, 2013
Please do not turn the page until the bell rings.
Rules:
The exam is closed-book, closed-note, closed calculator, closed electronics.
Please stop promptly at 4:20.
There are 114 points total,
A new ADT: Priority Queue
CSE373: Data Structures & Algorithms
Textbook Chapter 6
Nice to see a new and surprising data structure
A priority queue holds compare-able data
Like dictionaries and unlike stacks and queues, need to
compare items
Given x and
Spanning Trees
A simple problem: Given a connected undirected graph G=(V,E),
find a minimal subset of edges such that G is still connected
A graph G2=(V,E2) such that G2 is connected and removing
any edge from E2 makes G2 disconnected
CSE373: Data Struct
Single source shortest paths
Done: BFS to find the minimum path length from v to u in O(|E|+|V|)
Actually, can find the minimum path length from v to every node
Still O(|E|+|V|)
No faster way for a distinguished destination in the worst-case
Now: Weight
CSE373: Data Structures & Algorithms
Lecture 8: Amortized Analysis
Dan Grossman
Fall 2013
Amortized
Recall our plain-old stack implemented as an array that doubles its
size if it runs out of room
How can we claim push is O(1) time if resizing is O(n) ti
Name:
CSE373 Fall 2013, Final Examination
December 10, 2013
Please do not turn the page until the bell rings.
Rules:
The exam is closed-book, closed-note, closed calculator, closed electronics.
Please stop promptly at 4:20.
There are 114 points total,
CSE 373 Op)onal Sec)on
Union Find, Homework 4
2013-10-31 & 2013-11-05
A. Conrad Nied
Agenda
Candy
Interview Ques)on
Geopoli)cal Union Find
Homework 4
Interview Ques)on
Social network connec.vity. Given a social
n
CSE373 13au Final Review
Data Structures
Stacks: a list of elements, the main operations are to add and remove items to the front of
the list, burying old items in the stack.
Advantage: Simple FIFO
Disadvantage: O(n) searches, narrow operation
Queues: a l
Lecture 1: Math Review; Algorithm Analysis
CSE 373
Edition 2016
Topics
Review math essential to algorithm analysis
Proof by induction
Powers of 2
Binary numbers
Exponents and logarithms
Begin analyzing algorithms
Using asymptotic analysis (continue
Hello
!
Very nice to see you all again!
CSE 373
Data Structures
and
Algorithms
Presentation of the course
2016 Edition
Staff
Instructor
Marc Gaetano, marc.gaetano@gmail.com
Teaching Assistant
Lic Van Tran, vanlic.dn@gmail.com
CSE 373 - Presentation
3
Lecture 3: ADTs; Stacks/Queues
CSE 373
Edition 2016
Data structures
(Often highly non-obvious) ways to organize information to enable
efficient computation over that information
A data structure supports certain operations, each with a:
Meaning: what doe
10/5/2016
CSE373: Data Structures and Algorithms
Asymptotic Analysis (Big O, , and )
Steve Tanimoto
Autumn 2016
This lecture material represents the work of multiple instructors at the University of Washington.
Thank you to all who have contributed!
CSE 3
10/10/2016
Lets take a breath
So far weve covered
Some simple ADTs: stacks, queues, lists
Some math (proof by induction)
How to analyze algorithms
Asymptotic notation (Big-O)
CSE373: Data Structures and Algorithms
Dictionaries and Trees
Coming up.