Lecture 22, Revision 1 Lecture notes Java code – CodeFromLectures folder* Example class sheets – 4 of these plus solutions Extra examples (quicksort) Lab.

Slides:



Advertisements
Similar presentations
COSC 2007 Data Structures II Chapter 12 Advanced Implementation of Tables II.
Advertisements

Addition Facts
Chapter 9 continued: Quicksort
Chapter 7. Binary Search Trees
Singly linked lists Doubly linked lists
David Luebke 1 6/1/2014 CS 332: Algorithms Medians and Order Statistics Structures for Dynamic Sets.
CS16: Introduction to Data Structures & Algorithms
David Luebke 1 6/7/2014 CS 332: Algorithms Skip Lists Introduction to Hashing.
Singly Linked Lists What is a singly-linked list? Why linked lists?
David Luebke 1 6/7/2014 ITCS 6114 Skip Lists Hashing.
Data Structures: A Pseudocode Approach with C
Data Structures ADT List
Data Structures Using C++
John Hurley Cal State LA
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
1 Linked Lists A linked list is a sequence in which there is a defined order as with any sequence but unlike array and Vector there is no property of.
1 Designing Hash Tables Sections 5.3, 5.4, Designing a hash table 1.Hash function: establishing a key with an indexed location in a hash table.
1 Symbol Tables. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
Hash Tables.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Hash Tables,
Addition 1’s to 20.
Chapter 10: Data Structures II
Chapter 9: Data Structures I
Week 1.
Rizwan Rehman Centre for Computer Studies Dibrugarh University
Introduction to Recursion and Recursive Algorithms
Sorting (2nd part) & Binary Search Tree
Data Structures Data Structures Topic #13. Today’s Agenda Sorting Algorithms: Recursive –mergesort –quicksort As we learn about each sorting algorithm,
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
1 Assignment 2: (Due at 10:30 a.m on Friday of Week 10) Question 1 (Given in Tutorial 5) Question 2 (Given in Tutorial 7) If you do Question 1 only, you.
Data Structures Data Structures Topic #8. Today’s Agenda Continue Discussing Table Abstractions But, this time, let’s talk about them in terms of new.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
Review – Part 1 CSE 2011 Winter September 2015.
CS 3610 Midterm Review.
Midterm Review CSE 2011 Winter October 2015.
Final Review Dr. Yingwu Zhu. Goals Use appropriate data structures to solve real- world problems –E.g., use stack to implement non-recursive BST traversal,
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
MA/CSSE 473 Day 27 Hash table review Intro to string searching.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
CSC 212 – Data Structures Lecture 37: Course Review.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
Trees Chapter 23 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Data Structures: A Pseudocode Approach with C, Second Edition 1 Chapter 7 Objectives Create and implement binary search trees Understand the operation.
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Exam 2 Review CS 3358 Data Structures. 90 Total Points – 50 Points Writing Programs – 25 Points Tracing Algorithms, determining results, and drawing pictures.
CS6045: Advanced Algorithms Data Structures. Dynamic Sets Next few lectures will focus on data structures rather than straight algorithms In particular,
COMP 103 Course Review. 2 Menu  A final word on hash collisions in Open Addressing / Probing  Course Summary  What we have covered  What you should.
1 i206: Lecture 17: Exam 2 Prep ; Intro to Regular Expressions Marti Hearst Spring 2012.
Final Exam Review COP4530.
Final Exam Review CS 3358.
Midterm Review.
Exam Hints.
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.
structures and their relationships." - Linus Torvalds
CSE 326: Data Structures: Midterm Review
Final Exam Review COP4530.
EE 312 Software Design and Implementation I
CS6045: Advanced Algorithms
Binary Search Trees Chapter 7 Objectives
Final Review Dr. Yingwu Zhu.
EE 312 Final Exam Review.
EE 312 Software Design and Implementation I
CSE 326: Data Structures Lecture #14
structures and their relationships." - Linus Torvalds
Presentation transcript:

Lecture 22, Revision 1 Lecture notes Java code – CodeFromLectures folder* Example class sheets – 4 of these plus solutions Extra examples (quicksort) Lab assignments Old exam papers Should be familiar with all of these Course is Algorithms and Data structures (we choose to implement them in Java – a lot of this is done in the labs) Resources

Java 2 Exam will contain some Java – either for you to interpret, or to provide (e.g. give an interface for … give a recursive method to…. ) Make sure you know Java code sufficient to define a node of SLL, DLL, BST, AVLTree, BTree But not a whole program. Likely to have seen something similar in lectures (probably identical). We use pseudocode in lectures to give a quick, implementation independent idea of an algorithm. If asked to show something in Java you can not use PC (or vice versa). Can use it to illustrate how an algorithm works (but describe it in words too if it is complicated, plus diagrams)

Outline of course 1 3 Lecture 1-2 Revision. You will have been using these concepts throughout course so will know them now. Lecture 3-4 Singly linked lists: know how to build with head, head+tail, size instance variables and be able to discuss the complexity of operations e.g. add, delete, addInOrder for each version. Know Java methods for doing these operations. Generic linked list. Lecture 5 Doubly linked lists. Use of prev and next instance variables. (The hard bit came with recursion later on!) Lecture 6 Recursion. Two rules of recursion – reduce size of data set and provide a stopping condition. Be able to write simple recursive methods in Java. Use a recursion trace to illustrate how recursion works. Linear vs. Binary recursion. When do we use binary recursion?

Outline of course 2 4 Lecture 7 Recursion on linked lists. For singly linked lists this is quite straightforward, create a new singly linked list with head = next node along. Rejoin previous list to head of this list after recursion. For doubly linked lists much harder – create a new doubly linked list with head =next node. To be a DLL have to make prev of new list =null, so remember to rejoin previous list to head of new list, AND prev of head of new list to previous list. FUNDEMENTAL PROPERTY. *

Outline of course 3 5 Lecture 8-9 Algorithm analysis (complexity). Should be able to work with O notation now. Be able to analyse a simple algorithm or program for complexity, and compare the efficiency of two algorithms. Know how the different growth rates are related (e.g. O(n) grows faster than O(log n)). Dont need to use o, or notation. Lecture ADTs, Stacks, queues. What is an ADT? How is it implemented in Java?* Know basic interfaces for all of the ADTs we discuss in lectures (all have been given). And be able to describe implementations of them (usually an array-based and a linked list, or BST-based implementation). Stack, queue applications. Dont need Deque ADT.

Outline of course 4 6 Lecture Lists and iterators. List ADT. Basic idea of an iterator, what it is for, and how it is used. Iterable interface. Know the basic methods within Iterator inner class. May be asked to describe how you would implement an iterator for a given implementation of an ADT, but not to provide detailed code. JCF A basic idea of what this is (you may use it in level 3!) * Lecture Set ADT. Binary Search trees. Need to be able to define binary tree, binary search tree (whats the difference?) Traversals: preorder, inorder, postorder. Be able to define a node of a BST in Java, and simple methods (if given instance variables, and signature of method). Know how to add and delete nodes. Examples of balanced, unbalanced BSTs. Dont need expression trees.

Outline of course 5 7 Lecture 16 AVL Trees. Be able to define (i.e. what is difference between normal BST and an AVLTree?) Know how to do insertion via rotations, java to implement. Complexity of rotations*. Lecture 17 Btrees. Define m-way tree and Btree. Know how to do insertion in a Btree (see example sheets 3 and 4). Define node of Btree (need to look at code on web page). When do we use a Btree in practice (slide 12). Lecture MergeSort and QuickSort. In each case be able to give a description of the algorithm, with examples. Proofs of: MergeSort analysis (holds in general), QuickSort, best (like MS) and worst (when subarrays of size 1 and n-1). Understand cutoff and pivot selection via median of three approach.

Outline of course 6 8 Lecture Maps and hash tables. Know Map ADT (but not of Entry inner class). Hash tables, when would we use one? Be able to describe a hash table (e.g. picture of bucket array). Hash functions, hash codes. Hash collision resolution (chaining, open addressing, rehashing) – be able to write a paragraph on each, plus example. Implementation of Map via hash table – know vague idea.