jcollard / CS187

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CS187

My code for CS187 - Programming with Data Structures (Fall 2016) weekly programming projects. I got 100 on all of them. Below are the projects' summaries taken from instructions written by my professsor.

hangman-array/ list

overview

This problem will have you implement a game called Hangman, using an interface defining the logical view of a game board. You will write an implementation using arrays/ linked lists. In this assignment you will be starting from initial code provided by us, adding to and modifying it, and creating new classes similar to existing classes.

learning goals

  • Continue to exercise your understanding of arrays/ linked lists, interfaces, and classes.
  • Show ability to break a larger problem down into manageable pieces.
  • Read a specification in text and as a Java interface, and demonstrate understanding by implementing it.
  • Use existing JUnit test cases.

sets

overview

In this assignment you will build a class to represent a set; as in the mathematical concept of a set, a collection that has no duplicates. The class will be immutable (more later), generic, and will use Iterators. It will be implemented with linked lists. We will give you (in the support directory) the Set interface, and the LinkedNode class, and (in the src directory) skeletons for the LinkedSet and LinkedNodeIterator classes which you will complete. In this assignment you will be starting from initial code provided by us, and adding to and modifying it. You should not have to create any new classes or interfaces.

learning goals

  • Continue to exercise your understanding of linked lists.
  • Introduce the concept of immutable classes.
  • Introduce the concept of generics.
  • Show ability to write a class that implements a given interface.
  • Read a specification in text and as a Java interface, and demonstrate understanding by implementing it.
  • Use existing JUnit test cases.

postfix

overview

For this assignment, you will implement an evaluator for postfix expressions. Your evaluator will be stack-based, and capable of evaluating correctly-formed but otherwise arbitrary arithmetic expressions on ints. You will implement the stack using linked lists.

learning goals

  • Demonstrate understanding of a linked-list-based stack implementation.
  • Reinforce the concept of dynamic dispatch.
  • Understand and implement the core of an object-oriented, stack-based postfix expression evaluator.
  • Implement JUnit tests and drivers for a nontrivial code base.

hanoi

overview

For this assignment, you will implement a few algorithms recursively. Then, you’ll implement a generic collection. Finally, you’ll implement both the Tower of Hanoi game and a solution generator for that game.

learning goals

  • Practice implementing simple recursive methods, including mutually (indirectly) recursive methods.
  • Showabilitytowriteagenericclassthatimplementsagiveninterface,fulfillingthecontractitspecifies(including O() behavior and an Iterable implementation).
  • Model the Towers of Hanoi game and its solution using appropriate data structures and abstractions (e.g., stacks and lists).
  • Write a recursive solver for the Towers of Hanoi game.

queues

overview

In this project, you’ll exercise your understanding of queues and recursion. You’ll implement a specification for an unbounded queue, using unit tests you develop yourself. You’ll then use your queue implementation to list the entries in a directory tree. Finally, you’ll implement the merge sorting algorithm using a recursive approach.

learning goals

  • Demonstrate understanding of the implementation details of a generic unbounded queue.
  • Show understanding of algorithm that uses a queue and a Java API class to walk a directory tree.
  • Implement a sorting algorithm based upon queues and recursion.

recursive-list

overview

In this assignment, you will implement the List abstract data type, as specified in structures.ListInterface. Your implementation will be based upon references — that is, you’ll be building a singly linked list. You’ll implement all methods that must traverse the list using recursion rather than iteration. Finally, you’ll need to write your own tests for the code; we will not be providing a comprehensive test suite.

learning goals

  • Show ability to write a generic class that implements a given interface,fulfilling the contract it specifies (including O() behavior and an Iterable implementation).
  • Additional practice implementing recursive methods.

bst-scapegoat

overview

In this assignment, you’ll start with a codebase for binary search trees similar to that presented in lecture. You’ll need to implement several additional methods for binary search trees. Then, you’ll subclass the binary search tree to create a “scapegoat tree” — a simple form of a self-balancing binary search tree.

learning goals

  • Show understanding of binary trees, sufficient to implement several non-trivial methods.
  • Apply forethought to determine if iterative or recursive methods are more straightforward in various cases.
  • Learn and implement a simple extension to binary search trees based on a textual description of the extension.

heap-queues

overview

For this assignment you will be implementing a heap using an array; and implementing a min-priority queue and a max-priority queue.

learning goals

  • Develop your understanding of the priority queue abstraction and its implementation as a heap.
  • Meet the Comparator interface, and demonstrate your ability to use it.
  • Demonstrate your ability to read and understand a specification by implementing it.

About


Languages

Language:Java 100.0%