Week 15 – Monday CS221.

Slides:



Advertisements
Similar presentations
1 Chapter 24 Lists Stacks and Queues. 2 Objectives F To design list with interface and abstract class (§24.2). F To design and implement a dynamic list.
Advertisements

CS102 – Data Structures Lists, Stacks, Queues, Trees, Hash Collections Framework David Davenport Spring 2002.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Introduction to trees.
Week 2 - Monday.  What did we talk about last time?  Exceptions  Threads  OOP  Interfaces.
Information and Computer Sciences University of Hawaii, Manoa
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Week 8 - Monday.  What did we talk about last time?  BST traversals  Get range implementation.
CS102 – Data Structures Lists, Stacks, Queues, Trees & HashTables. David Davenport.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
Week 2 - Friday.  What did we talk about last time?  Computing Big Oh.
Week 15 – Wednesday.  What did we talk about last time?  Review up to Exam 1.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Symbol tables.
Week 4 - Friday.  What did we talk about last time?  Continued doubly linked list implementation  Linked lists with iterators.
Data Structures David Kauchak cs302 Spring Data Structures What is a data structure? Way of storing data that facilitates particular operations.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Week 15 – Monday.  What did we talk about last time?  Tries.
Chapter 3 Lists, Stacks, Queues. Abstract Data Types A set of items – Just items, not data types, nothing related to programming code A set of operations.
Final Exam Review COP4530.
Final Exam Review CS 3358.
CSCE 210 Data Structures and Algorithms
Elementary Data Structures
Week 2 - Wednesday CS221.
Computing with C# and the .NET Framework
Week 4 - Monday CS221.
Data Structure By Amee Trivedi.
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Chapter 12 – Data Structures
Stacks – review A Last-In First-Out (LIFO) structure Basic Operations:
Week 7 - Friday CS221.
Week 4 - Friday CS221.
Chapter 15 Lists Objectives
Heaps And Priority Queues
Week 3 - Friday CS221.
Week 6 - Wednesday CS221.
Week 2 - Friday CS221.
Cinda Heeren / Geoffrey Tien
October 30th – Priority QUeues
Week 11 - Friday CS221.
Cse 373 April 26th – Exam Review.
November 1st – Exam Review
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
Stacks – review A Last-In First-Out (LIFO) structure Basic Operations:
CSE 326: Data Structures: Midterm Review
Building Java Programs
structures and their relationships." - Linus Torvalds
Review for Exam 1 Topics covered: For each of these data structures
Data Structures and Algorithms
Lesson Objectives Aims
Final Exam Review COP4530.
ITEC 2620M Introduction to Data Structures
Lesson 6. Types Equality and Identity. Collections.
Implementing Hash and AVL
CS6045: Advanced Algorithms
Stacks and Queues 1.
CS 2430 Object Oriented Programming and Data Structures I
More Data Structures (Part 1)
EE 312 Final Exam Review.
Queues cont. Chapter 8 © 2011 Pearson Addison-Wesley. All rights reserved.
Lecture 16 Stacks and Queues CSE /26/2018.
Instructor: Dr. Michael Geiger Spring 2019 Lecture 34: Exam 3 Preview
structures and their relationships." - Linus Torvalds
Week 6 - Monday CS221.
Data Structures & Programming
Presentation transcript:

Week 15 – Monday CS221

Last time What did we talk about last time? Regular expressions

Questions?

Project 4 Graphic Violence

Final Exam Format Half short answer questions Half programming Designed to take 2 hours (50% longer than the previous exams) But, you will have the full 3 hour time period The focus will be on the second half of the semester Look for things that were not covered on previous exams

Review up to Exam 1

Review

Week 1 Programming model Java Java Collections Framework OOP Polymorphism Interfaces Threads Exceptions Generics Java Collections Framework

Week 2 Big Oh Notation Big Omega and Big Theta Abstract Data Types Formal definition: f(n) is O(g(n)) if and only if f(n) ≤ c∙g(n) for all n > N for some positive real numbers c and N Worst-case, asymptotic, upper bound of running time Ignore lower-order terms and constants Big Omega and Big Theta Abstract Data Types Array-backed list

Week 3 Stacks Queues FILO data structure Operations: push, pop, top, empty Dynamic array implementation Queues FIFO data structure Operations: enqueue, dequeue, front, empty Circular (dynamic) array implementation JCF implementations: Deque<T> interface ArrayDeque<T> LinkedList<T>

Week 4 Linked lists Special lists Linked list implementation of stacks Performance issues Single vs. double Insert, delete, find times Special lists Circular Skip Self-organizing Linked list implementation of stacks Linked list implementation of queues

Sample Problems

Running time What’s the running time of the following code? int count = 0; for(int i = 1; i <= n; i++) for(int j = 1; j <= n; j++) for(int k = 1; k <= n; k+=j) count++;

Array list class public class ArrayList { private String[] array = new String[10]; private int size = 0; … } Complete the following a method to insert a value in an arbitrary index in the list. You may have to resize the list if it doesn't have enough space. public void insert(String value, int index)

BST and linked list classes public class Tree { private static class Node { public String key; public Node left; public Node right; } private Node root = null; … public class List { private static class Node { public String value; public Node next; } private Node head = null; …

Remove alternate nodes Write a method in the List class that will remove every other node (the nodes with even indexes) from a linked list public void removeAlternateNodes()

Tree to Linked List Write a method that takes a binary search tree and returns an ordered linked list Write the method in the Tree class Assume you are given a linked list with an add() method that can add to the front of the list Hint: Use a reverse inorder traversal Recursive method: private static void toList(List list, Node node) Proxy method: public List toList() { List list = new List(); toList(list, root); return list; }

Upcoming

Next time… Review up to Exam 2 Recursion Binary trees 2-3 and red-black trees Hash tables Graph basics Review Chapters 3 and 4

Reminders Bring a question to class Wednesday! Any question about any material in the course Keep working on Project 4 Due Friday Study for final exam 7:30 - 10:30am, Monday, 12/11/2017 (Section A) 2:30 - 5:30pm, Monday, 12/11/2017 (Section B)