Week 15 – Monday.  What did we talk about last time?  Tries.

Slides:



Advertisements
Similar presentations
CS252: Systems Programming Ninghui Li Program Interview Questions.
Advertisements

CHAPTER 4 Queues. Queue  The queue, like the stack, is a widely used data structure  A queue differs from a stack in one important way  A stack is.
CHAPTER 4 Queues MIDTERM THURSDAY, OCTOBER 17 IN LAB.
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.
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 3 - Wednesday.  What did we talk about last time?  Started linked lists.
Week 7 - Wednesday.  What did we talk about last time?  Recursive running time  Master Theorem  Introduction to trees.
Chapter 6.6, (event-driven simulation) Queues 1CSCI 3333 Data Structures.
Week 2 - Monday.  What did we talk about last time?  Exceptions  Threads  OOP  Interfaces.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
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.
Week 7 - Friday.  What did we talk about last time?  Trees in general  Binary search trees.
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.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
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.
Elementary Data Structures
CSC317 Selection problem q p r Randomized‐Select(A,p,r,i)
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:
Marcus Biel, Software Craftsman
Week 4 - Friday CS221.
12 C Data Structures.
Chapter 15 Lists Objectives
Heaps And Priority Queues
Week 6 - Wednesday CS221.
Cinda Heeren / Geoffrey Tien
Week 15 – Monday CS221.
Week 11 - Friday CS221.
Cse 373 April 26th – Exam Review.
November 1st – Exam Review
Chapter 12 Collections.
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
Stacks – review A Last-In First-Out (LIFO) structure Basic Operations:
THURSDAY, OCTOBER 17 IN LAB
CSE 326: Data Structures: Midterm Review
Lesson Objectives Aims
Final Exam Review COP4530.
Lesson 6. Types Equality and Identity. Collections.
Implementing Hash and AVL
Chapter 24 Implementing Lists, Stacks, Queues, and Priority Queues
Chapter 12 Collections.
Introduction to Data Structure
Chapter 4 Queues.
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
Abstract Data Types Stacks CSCI 240
Queues.
Data Structures & Programming
Presentation transcript:

Week 15 – Monday

 What did we talk about last time?  Tries

Graphic Violence

 Add the following words to a trie:  ""  "fib"  "fibula"  "fig"  "figure"  "pi"  "pig"  "wig"

 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

 Programming model  Java  OOP  Polymorphism  Interfaces  Threads  Exceptions  Generics  Java Collections Framework

 Big Oh Notation  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

 Stacks  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 interface  ArrayDeque  LinkedList

 Linked lists  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

 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++;

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)

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

 Write a method in the List class that will remove every other node (the even numbered nodes) from a linked list public void removeAlternateNodes()

 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 void toList(List list, Node node) Proxy method: public List toList() { List list = new List(); toList(list, root); return list; }

 Review up to Exam 2  Recursion  Master Theorem  Binary Trees  2-3 and Red-black trees  Hash tables  Review Chapter 3

 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  2:30 - 5:30pm, Monday, 12/07/2015