Spring 2013 COP 3503 Recitation Worksheet #1 Solution
Your group should brainstorm solutions to one or two of these questions. Instead of writing
code to solve the problems, write out a clear algorithm, independent of any programming
language to solve eac
Formal Analysis of Functions
(Feat. Nested Summations and a Geometric Sum)
Slides by Sean Szumlanski
for COP 3503, Computer Science II
Fall 2016
Check Your Understanding
int foo(int n)
cfw_
int i, j, k, x = 0;
for (i = 1; i <= n; i+)
for (j = 1; j <= n; j
Advanced File Structures Hashing
Introduction
For most of this term we have studied a variety of data structures whose
primary purpose was the representation of data contained in main memory that
supported an algorithm during its execution. With the excep
Computer Science II Exam #1 Solution
Date: 2/14/2013
1) (9 pts) Solve the following recurrence relations using the Master Theorem:
a) T(n) = 4T(n/2) + O(n2)
Bk = 22 = A = 4
T(n) = O(n2lg n)
Grading: 3 pts all or nothing on each part.
b) T(n) = 7T(n/3) + O
2013 Spring Computer Science 2 Exam #1 Review Solutions
RADIX SORT
Perform a radix sort on the following numbers:
Initial state:
First sort:
Second sort:
Third sort:
Final sort:
9123
4781
9123
9123
2223
3826
9123
2223
9183
3448
4783
4783
3826
2223
3826
34
COP 3503 Computer Science II CLASS NOTES - DAY #26
More Graph Problems
Hamiltonian Graphs
A Hamiltonian cycle in a graph is a cycle that passes through all the vertices of the
graph. Recall that we mentioned this type of cycle when we were examining Euler
COP 3503 Computer Science II CLASS NOTES - DAY #25
More Graph Problems
Cycle Detection Algorithms
Many algorithms rely on detecting cycles in graphs. Many cycle detection
algorithms are brute force algorithms and are quite inefficient. However, there
are
COP 3503 Computer Science II CLASS NOTES - DAY #24
Graph Problems Continued
Euler Circuits
Consider the three figures (a) (c) shown below. A puzzle for you to solve is to
reconstruct these three figures using a pencil and paper drawing each line exactly
o
COP 3503 Computer Science II CLASS NOTES - DAY #23
Graphs Continued
Graph Traversals
As with trees, traversing a graph consists of visiting each vertex only one time.
The simple traversal algorithms used for trees (preorder, inorder, postorder) cannot
be
COP 3503 Computer Science II CLASS NOTES - DAY #22
Graphs
In spite of the flexibility of trees and the many different tree applications, trees, by
their very nature, have one limitation, namely, they can only represent
relationships of a hierarchical type
COP 3503 Computer Science II CLASS NOTES - DAY #21
Heaps and Priority Queues
A priority queue is essentially a list of items in which each item has associated
with it a priority. In general, different items may have different priorities and thus
we speak
COP 3503 Computer Science II CLASS NOTES - DAY #20
Beyond Binary Search Trees
The last couple of days notes have introduced special case of the binary tree
known as the binary search tree (BST) and the self-balancing search tree known as
the AVL tree. Gen
COP 3503 Computer Science II CLASS NOTES - DAY #14
Implementation Issues
As we begin the second half of the course, our focus shifts from examining
problem-solving techniques and asymptotic algorithm analysis toward the issues
involved with the implementa
Spring 2013 COP 3503 Recitation Worksheet #3 Solutions
Use this graph for questions 1 and 2:
1) Show the order in which the vertices in the following graph get visited in a breadth first search, starting
at vertex A. Any time multiple vertices are being a
Data Structures Review
COP 3503, Fall 2016
1. Hash Tables
a. What is the key difference between Javas HashSet and HashMap containers?
b. What are the best- and worst-case runtimes for insertion into hash tables using:
i) Linear Probing
ii) Quadratic Probi