CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #11, March 30th
Attendance: Optional
Evaluation: lab score = combined score on todays exercises,
by the 6pm due date
Goal
We are making the transition to C+ this week, and so the goal in lab tod

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #2, September 1st
Attendance: Mandatory
Evaluation: Show results to your TA before leaving
Goal
The goal today is to work with binary search trees: defining, building, traversing, and printing. Th

CS 251 / Fall 2016
Quiz #3: Monday, November 14th
Name: _ SOLUTION KEY _
Graphs: BFS and DFS
LAST 4 DIGITS OF ID: _
(20 points)
1) Consider the following Graph:
a) Perform a BFS starting at vertex 0; assume BFS visits vertices in ascending order. What ver

CS 251 / Fall 2016
Quiz #1: Wednesday, September 14th
Name: _
Short Answer
LAST 4 DIGITS OF ID: _
(25 points)
1) Build a binary search tree by inserting the following values in this order: 14, 28, 56, 21, 7, 42, 10, 70.
2) Consider the following binary se

CS 251 / Fall 2016
Quiz #3: Monday, November 14th
Name: _
Graphs: BFS and DFS
LAST 4 DIGITS OF ID: _
(20 points)
1) Consider the following Graph:
a) Perform a BFS starting at vertex 0; assume BFS visits vertices in ascending order. What vertices are
visit

CS 251 / Fall 2016
Exam: Wednesday, October 26th
Name: _ SOLUTION KEY _
LAST 4 DIGITS OF ID: _
Short Answer
(20 points)
1) Fill in the following table with the requested time complexity in big-Oh notation for the average case.
Time to search for 1
element

CS 251 / Fall 2016
Quiz #2: Monday, October 10th
Name: _
LAST 4 DIGITS OF ID: _
AVL Trees
(18 points)
1) Consider the following AVL tree. In the boxes within each node, write the height of the sub-tree:
2) What is the height of the tree pictured above?
3)

CS 251 / Fall 2016
Quiz #2: Monday, October 10th
Name: _
LAST 4 DIGITS OF ID: _
AVL Trees
(18 points)
1) Consider the following AVL tree. In the boxes within each node, write the height of the sub-tree:
2) What is the height of the tree pictured above?
3)

CS 251 / Fall 2016
Exam: Wednesday, October 26th
Name: _
LAST 4 DIGITS OF ID: _
Short Answer
(20 points)
1) Fill in the following table with the requested time complexity in big-Oh notation for the average case.
Array
Linked-list
(singly-linked)
BST
AVL t

CS 251 / Fall 2016
Quiz #1: Wednesday, September 14th
Name: _
Short Answer
LAST 4 DIGITS OF ID: _
(25 points)
1) Build a binary search tree by inserting the following values in this order: 42, 70, 56, 14, 28, 21, 7, 10.
2) Consider the following binary se

CS 251 / Fall 2016
Quiz #4: Friday, December 2nd
Name: _
LAST 4 DIGITS OF ID: _
C+
(50 points)
1) On what line is the constructor for vector called?
2) On what line is the destructor for vector called?
3) What vector function is called on line 21? Circle

CS 251 / Fall 2016
Quiz #4: Friday, December 2nd
Name: _ SOLUTION KEY _
LAST 4 DIGITS OF ID: _
C+
(50 points)
1) On what line is the constructor for vector called? [ 6 pts ]
12
2) On what line is the destructor for vector called? [ 6 pts ]
24
3) What vect

NAME:_sample-soln_
SIGNATURE:_
CS251, Spring 2016
Final Exam
120 Minutes
Please wait until everyone has their exam before opening!
PART I
QUESTION 1 (30 points): Below and on the next two pages are
three is a C function operating on an arrays of length n.

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #1, August 25th
Attendance: Mandatory
Evaluation: Submit results to your TA before leaving
Goal
The goal today is to experiment with sorting, and compare the execution times of selection sort with

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #4, September 15th
Attendance: Mandatory
Evaluation: Show results to your TA before leaving
Goal
Today were going to start working towards implementing balanced binary search trees. To that end, w

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #9, October 20th
Attendance:
Complete by:
Optional but encouraged
11:59pm October 20th
Evaluation:
Policy:
# of test cases passed for zyLab exercises 5.10
individual work only, late work not accep

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #13, April 13th
Attendance: Optional
Evaluation: lab score = combined score on todays exercises,
by the 6pm due date
Goal
The goal in lab today is to continue programming in C+, and learn a bit

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #14, April 20th
Attendance: Optional
Evaluation: lab score = score on todays exercise, max score of
100 if submitted before 11:59pm @ end of 4/20, or
75 if submitted before 11:59pm @ end of Fri

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #6, February 16th
Attendance: Mandatory
Evaluation: Show results to your TA before leaving
Goal
As many of you know, finding memory errors in a C program is very difficult. This is especially tr

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #2, January 19th
Attendance: Mandatory
Evaluation: Show results to your TA before leaving
Goal
The goal today is to work with binary search trees: defining, building, traversing, and printing. T

CS 251
Data Structures
Spring 2017
Lab Week #03: Binary Search Tree ADT
Name: _
Netid: _
Suppose we need to adapt the BST ADT to a situation where the key is a real number, and the
value is 3 integers. What typedefs would you change, and how would you cha

CS 251
Data Structures
Spring 2017
Lab Week #01: Selection Sort vs. Quicksort
Name: _
Netid: _
As discussed in the lab handout, record the observed execution times of each algorithm for
each value of N. You may not be able to record the execution times fo

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #4, February 2nd
Attendance: Mandatory if you have not yet finished HW #07
Evaluation: lab score = HW #07 score
Goal
The goal for lab today is to help you finish HW #07: exercises described in z

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #12, April 6th
Attendance: Optional
Evaluation: lab score = score on Zyante exercise section 5.5
Due Date:
Today (April 6th) @ 6pm
Goal
The goal of lab today is to get started implementing Graph

CS 251
Data Structures
Spring 2017
Lab Section Handout: Week #7, February 23rd
Attendance: Optional
Evaluation: lab score = HW #11 score
Goal
The goal for lab today is to help you with HW #11: zybook section 4.23, AVL Rotations. You can work on
HW #11 in

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #3, September 8th
Attendance: Mandatory
Evaluation: Show results to your TA before leaving
Goal
The goal today is to create a binary search tree ADT (Abstract Data Type). We introduced the notion

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #7, October 6th
Attendance:
Complete by:
Evaluation:
Policy:
Optional but encouraged
2:00pm October 6th
# of test cases passed for zyLab exercises
3.9 and 3.10
individual work only, late work not

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #6, September 29th
Attendance:
Complete by:
Evaluation:
Policy:
Optional but encouraged
2:00pm September 29th
# of test cases passed for zyLab exercises 3.6
and 3.7; exercise 3.8 is encouraged but

CS 251
Data Structures
Fall 2016
Lab Section Handout: Week #10, October 27th
Attendance:
Complete by:
Optional but encouraged
11:59pm October 27th
Evaluation:
Policy:
pass at least the first 2 test cases of section 5.12
individual work only, late work not