Homework #1
Due on Tuesday, Sep. 1st, before class starts
1.
a)
Assume you have an empty stack, show the stack after a sequence of operations: push(a), push(b),
pop, push(c), push(d), pop, pop, push(e), pop. (10pts)
b)
Assume you have an empty queue, show
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #1
Due on Monday, Sep. 9th, 4:45pm
1. a. Assume you have an empty stack, show the stack after a sequence of operations:
push(a), push(b), pop, push(c), push(d), push(e), pop, pop. (10pts)
b. Assu
CSCE 350 Data Structures and Algorithms
Fall, 2015
Homework #3
Due on Friday, Oct. 9 before class ends.
1. The determinant of an n-by-n matrix
11
=[
1
1
]
denoted detA, can be defined as a11 for n = 1 and, for n > 1, by the recursive formula
= 1
=1
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #5
Due on Wednesday, Nov. 20 before class ends.
1. a. Apply Horspools algorithm to search for the pattern CDOBAB in the text
WHO_KNEW_ABOUT_CDOBABS
How many comparisons you need for searching for
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Final Exam Sample Question Set
Name:
Student #:
Important Notice:
This is a closed-book, closed-note exam! Only a double-side letter-size
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Midterm Exam 2
3:30pm-4:45pm, November 4, 2013
Name:
Important Notice:
This is a closed-book, closed-note exam! Only a single-side letter-
Summary: Methods for Solving Recurrence
Relations
Forward substitutions
Backward substitutions
Linear 2nd order recurrences with constant coefficients
Example: Find the Number of Binary
Digits (Recursive Algorithm)
Find the Number of Binary Digits in the
Reminder
Midterm Exam 1
Tuesday Sep. 23rd in class
Covered material: 1st class the class on Thursday Sep. 18th
Do not forget to prepare your cheat sheet (a single-side lettersize paper)
Solution to Important Recurrence Types
One (constant) operation re
Brute Force
From now on, we are going to learn some basic and general
strategies in designing algorithms to solve some typical
computing problems.
We will analyze the efficiency of these algorithms using the
tools learned in the past several classes
We wi
Announcement
HW #3 is posted on the website and dropbox.
Due: Tuesday, Oct. 7 before class ends
Chapter 5: Decrease and Conquer
Reduce problem instance to smaller instance of the same
problem
Solve smaller instance
Extend solution of smaller instance to o
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #2
Due on Monday, Sep. 23rd before class ends.
1. For each of the following functions, indicate the class () the function belongs to.
(Use the simplest () possible in your answers.) Prove your as
CSCE 350 Data Structures and Algorithms
Fall, 2015
Homework #2
Due on Wednesday, September 16th before class starts
1. For each of the following functions, find a function () such that () ().
You must use the simplest () possible in your answers such as ,
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Midterm Exam 1 (Sample Test)
Name:
Important Notice:
This is a closed-book, closed-note exam! Only a single-side letter-size cheat sheet i
CSCE 350 Data Structures and Algorithms
Fall, 2015
Homework #4
Due on Friday, Oct. 30 before class ends.
1. Apply mergesort to sort a list of numbers 21, 78, 33, 17, 15, 89, 51, 13 in a
nondecreasing order. Show the mergesort operation following the examp
CSCE 350 Data Structures and Algorithms
Fall, 2015
Homework #2
Due on Thursday, September 15th before class ends
() such that () ().
You must use the simplest () possible in your answers such as , , , 2 , 3 ,
, and product of them. Prove your assertion.
Analyze the Time Efficiency of An Algorithm
Nonrecursive Algorithm
Matrix multiplication
Selection sort
etc
ALGORITHM Factorial ( n )
f 1
for i 1 to n do
f f *i
return f
Recursive Algorithm
Fibonacci number
Merge sort
etc
ALGORITHM Factorial ( n )
i
Theoretical Analysis of Time Efficiency
Time efficiency is analyzed by determining the number of
repetitions of the basic operation as a function of input size
Basic operation: the operation that contributes most towards the
running time of the algorithm.
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Midterm Exam 1 (Sample Test)
Name:
Important Notice:
This is a closed-book, closed-note exam! Only a single-side letter-size cheat sheet i
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #6
Due on Monday, Dec. 2nd before class ends.
1. Apply Prims algorithm to find the minimum spanning tree (MST) for the following
graph. For each step, you need to give the priority queue includin
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Midterm Exam 1
3:30pm-4:45pm, September 30, 2013
Name:
Important Notice:
This is a closed-book, closed-note exam! Only a single-side lette
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #4
Due on Monday, Oct. 28 before class ends.
1. Apply mergesort to sort a list of numbers 21, 13, 33, 27, 15, 89, 51, 13 in a
nondecreasing order. Show the mergesort operation following the examp
Name_ ID#_ Score_
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Quiz 1
Wednesday, September 11, 2013
For each of the following functions (), find a function () such that () (). You need
Name_ Score_
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Quiz 2
Monday, October 14, 2013
For the digraph shown below, starting at vertex a and resolving ties by the vertex alphabetica
CSCE 350 Data Structures and Algorithms
Fall, 2013
Homework #3
Due on Monday, Oct. 14 before class ends.
11
=
1
1. The determinant of an n-by-n matrix
1
= 1
denoted detA, can be defined as a11 for n = 1 and, for n > 1, by the recursive formula
=1
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Midterm Exam 2 (Sample Test)
Name:
Important Notice:
This is a closed-book, closed-note exam! Only a single-side letter-size cheat sheet i
Name_ Score_
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Quiz 4
Wednesday, November 18, 2013
Use Floyds algorithm to solve the all-pairs shortest path problem for the given digraph. Y
Name_ Score_
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Quiz 5
Wednesday, December 4, 2013
Apply the branch-and-bound algorithm to solve the traveling salesman problem for
a graph re
Name_ Score_
Department of Computer Science and Engineering
University of South Carolina
CSCE350: Data Structures and Algorithms
Quiz 3
Wednesday, October 30, 2013
Perform HeapSort for a list of 8 numbers [32,13,1, 4, 9, 7,14, 25] so that the sorted numbe
CSCE350: Data Structures and Algorithms
Fall 2014
Dr. Yan Tong
Todays Agenda
Welcome.
Various administrative issues.
What is algorithm?
What is this course about?
On This Course
Instructor: Yan Tong,
SWGN 3A52, 777-0801, tongy@cec.sc.edu
Office Hours: TR