COP 4530 Exam 1
Name
_
1. (a) You are to complete the function below that replaces each occurrence of value x by value y in a
templated Queue, leaving the order of the other elements unchanged. You may only use variables of type T
(the template type) and
COP 4530 Exam 2 Practice Questions Not all topics are covered by these examples
1.
Draw the tree that results when the node with value 30 is deleted from the binary search tree below.
Answer:
COP 4530 Exam 2 Practice Questions Not all topics are covered b
COP 4530 Data Structures - Spring 2014
Instructor:
Dr. Ralph Tindell
Dept. of Computer Science and Engineering
ENB 338, 813-974-3032, rtindell@cse.usf.edu
Open Office Hours: MW, 1:30 pm -3:30 pm; T-Th, 2:30 pm -4:00 pm
Other hours possible by email appoin
COP 4530
Exam 2
Fall 2014
Answer the questions in the spaces provided on the exam. If you run out of
room for an answer, continue on the back of the page.
Note that you must justify all answers!
Name:
U#:
Question
Points
1
15
2
15
3
15
4
15
5
15
6
15
7
10
COP 4530 Exam 1
Name
_
1. (a) You are to complete the function below that replaces each occurrence of value x by value y in a
templated Queue, leaving the order of the other elements unchanged. You may only use variables of type T
(the template type) and
Bit Output using a BitOStream
data_buffer holds the
class BitOStream
bits being output
cfw_
bit_mask specifies the
private:
unsigned char data_buffer; position in the data byte
for the next output bit
unsigned char bit_mask;
ofstream fout;
A completely fi
Read (8.4 & 8.5)
8. Part I: Run-Time Arrays Intro. to Pointers
For declarations like
double doubleVar;
char charVar = 'A';
int intVar = 1234;
the compiler constructs the object being
declared, which means that it:
1. Allocates memory needed for
that type
A Beginners Guide to Big O Notation
(adapted from http:/rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/)
Big O notation is used in Computer Science to describe bounds on the performance or
complexity of an algorithm. One standard use of the Big
Binary Encodings
A binary encoding of an object M is an assignment of a string of
zeros and ones to M.
For our purposes, M will be a string of symbols from some
alphabet (Greek, Arabic, Hebrew, ascii, . . . ).
One instance of encoding is for error detecti
Huffman Compression Project
In this project you are to implement the Huffman code algorithm as a
file compression/uncompression utility.
You will scan the input text file to be compressed and compute the
frequencies of each character that appears in the f
Bit Representation of Binary Trees
Implementation of the Huffman compression algorithm requires a way
to write a compact representation of a binary tree in such a way that the
tree may be easily recovered.
We will do this using the preorder traversal idea
COP 4530: Data Structures
3 Credits
Fall 2014
Administrative Information
1. Instructor: Dr. Tina Kouri
2. Department: Computer Science and Engineering, College of Engineering
3. Oce: ENB 339
4. E-Mail: tkouri@cse.usf.edu
5. Phone: (813) 974-2126
6. Walk-
COP 4530: Data Structures
Academic Integrity Armation
Group Name:
Group #:
I swear (or arm) that I have not given or received any unauthorized assistance.
1. All work on this project ours and ours alone.
2. I have only used authorized resources to complet
COP 4530: Data Structures
Academic Integrity Armation
Name:
U#:
I swear (or arm) that I have not given or received any unauthorized assistance.
1. All work on this project is mine and mine alone.
2. I have only used authorized resources to complete this p
COP 4530 Attendance
Your signature assures me that you attended the full lecture on December 2, 2014.
Name
Signature
Name
Signature
Name
Shawn Abtey
Phuc Lam
Vaddanak Seng
Luis Aguilera
Christopher Lamb
Yongzhuo Shao
Alfredo Antolinez
Maxwell Landes
Bradl
COP 4530
Fall 2014
This form is required for rst day attendance. Students who do not complete this form
will be dropped from the course.
1. Name (print legibly):
2. U#:
3. What is your major?
4. What is your level (e.g., freshman, sophomore, junior, senio
Homework Problems
Review for Exam
You are to do the following problems from
the text and be ready to present any of
them in class Tuesday.
R-3.12, page 149
R-4.4, R-4.13, R-4.15 R-4.20 pages
185-186
R-5.3, R-5.4, R-5.5, R-5.9, R-5.10, page
223
1. Complete the code for the function below that computes the outdegrees of all
vertices of a digraph given by its adjacency matrix. The parameters are as
follows:
vcount
The number of vertices
adj
The adjacency matrix represented as a vector of vectors
Solutions for Exercises 1-12, page 563-564
1.
O(n3)
2.
O(2n)
3.
O(n)
4.
O(2n)
5.
Retrieving the first element of any ordered collection, e.g., second element of an array,
fourth line of a file, third element in linked list, seventh element in stack, etc.
Old DS Exam 3
1. (a) Fill in the adjacency list representation of G.
a
b
c
d
e
f
(b) Fill in the adjacency matrix representation of G.
a
a
b
c
d
e
f
b
c
d
e
f
Old DS Exam 3
(c) Fill in the adjacency list representation of D.
a
b
c
d
e
f
(d) Fill in the ad