## CS 314: Study Guide for Midterm Exam

### Date: Thursday, March 12, 2015, in class.

Weiss, Data Structures & Problem Solving Using Java, Sections 1, 5 - 5.2, 2 - 2.4, 17.1, 7 - 7.3.4, 17.3, 17.4, 11 - 11.1, 6 - 6.6, 16, 18 - 18.4, 19 - 19.1, 19.3. Class lecture notes.

### Material covered in class:

• Big O:
• Meaning of Big O; names of Big O classes (quadratic, etc.)
• Given a function for time vs. n, reduce it to Big O.
• Ranking of Big O: which is better
• Big O for common algorithms
• Estimate Big O for some given code
• log(n) grows slowly
• Estimate Big O from a log-log plot, from time ratios
• cons, first, rest: be able to give the result of a call to these functions, and the ones below.
• length, reverse, append, member, assoc
• intersection, union, set-difference
• merge, sort
• mapcar
• some, every, subset
• Stack: using linked list, using array. Order in which items come out: LIFO.
• push, pop
• Queue: using linked list, using array. Order in which items come out: FIFO.
• Java Collections:
• ArrayList
• Iteration over a Collection
• Trees:
• Binary tree
• First-child / next-sibling tree