CMPSCI 187 Midterm 1 (Feb 17, 2016)
Instructions:
This is a closed book, closed notes exam. You have 120 minutes to
complete the exam.
The exam has 10 pages printed on double sides. Be sure to check
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
tANSWERKEY:
1)c.
2)e.morethanoneispossible
Twopossibilities:
F
AD
ECHB
KG
Inorder:EACKFHDBG
PostOrder:EKCAHGBDF
K
AD
ECHB
FG
Inorder:EACKFHDBG
PostOrder:ECAFHGBDK
3)a.true
4)b.false(Alistisaninterface
An Unbounded Array Queue
DJW implement an unbounded array-based queue
class. As with the standard Java class
ArrayList, the main idea is to increase the size of
the array when it becomes full, copying
1
First Exam Study Sheet
Chem 111 Sections 2 and 3, Spring 2017
-No units other than scientific ones will be used (i.e., no ounces, gallons, or other units not used
in scientific research). Students s
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
Reminders and Topics
Search is due this Friday
This lecture:
Simple Sorting O(N2)
Bubble Sort, Selection Sort, Insertion Sort
Merge Sort O(N logN)
1
A Familiar Example
Sorting
Given an array of compar
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
Programming With Data Structures
Introduction to Graphs
Reminders and Topics
Priority Queues due this Friday 4pm
This and next lectures:
Graphs
Representation of Graphs
Search in Graphs
2
Graphs
Simil
Reminders and Topics
Heap Queues due this Friday 4pm
This lecture:
Depth-First Search in Graphs
Breadth-First Search in Graphs
Search Applications
1
Graph Search / Traversal
Graph search / traversal i
Programming with
Data Structures
CMPSCI 187
Fall 2016
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other inter
Programming with
Data Structures
CMPSCI 187
Fall 2017
Please find a seat
Try to sit close to the center (the room will be pretty full!)
Turn off or silence your mobile phone
Turn off your other intern
Lecture 5: Java Review
Continued
Java Primitive Data Types and Operations
Objects, References, Aliasing, GC
Parameter passing
Inheritance and dynamic typing
Variable scope
Conditional statements and l
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #1
John Ridgway
January 20, 2015
Contents
1 Introduction
1
2 Administrative Stu
1
3 Software Engineering
2
1
Introduction
About the Cou
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #4
John Ridgway
February 5, 2015
1
Abstract Data Types
Abstract Data Types (ADTs)
Abstraction.
Information hiding.
Data abstraction.
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #6
John Ridgway
February 12, 2015
Administrivia
Collect papers for discussions 2 and 3.
First exam Feb 19 at 7:00pm in Marcus 131. If
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #17, Implementing Binary Search Trees
John Ridgway
April 2, 2015
1
Implementing Binary Search Trees
Review: The BST Interface
Binary s
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #19, Heaps and Priority Queues
John Ridgway
April 9, 2015
1
Heaps
Review: The Idea of a Heap
A heap is a data structure that keeps som
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #18, Using Binary Search Trees
John Ridgway
April 7, 2015
1
Using Binary Search Trees
Review: Balancing a BST
As weve discussed, nding
CmpSci 187: Programming with Data Structures
Spring 2015
Lecture #20, Introduction to Graphs
John Ridgway
April 14, 2015
1
Introduction to Graphs
Graphs and their Vocabulary
Linear lists and trees ar
Linked StringLogs
The Linked List Data Structure
Arrays vs. Linked Lists
The LLStringNode Class
Operations on a Linked List
A linked-list implementation of StringLog
1
Linked List
A series of nodes ch
Reminders
Project 4 is due this Friday 11:59pm.
This Lecture: Algorithm Analysis (Big-O notation)
1
What is Algorithm Analysis?
Resources (time, memory etc.) used by an algorithm,
as a function of the
Reminders and Topics
Project 8 (Recursive List) due this Friday
Midterm 2 is Wednesday Nov 15, 7-9pm in Marcus 131
Makeup and DS accommodations must be received by
Thursday, Nov 9.
This lecture:
Bi
The List ADT and Comparisons
We now begin our study of the List ADT general
types of collections of objects.
To avoid confusion, we are discussing the List ADT,
not linked list. The List ADT can be im
Reminders
Midterm 2 is Wednesday next week 7-9pm MARC 131
Project 9 release today and due Friday next week
Next monday lab: midterm 2 preparation
Midterm 2 covers: lectures 9-17
Topics of this lecture