Lecture 2 Basic Data Structures and Recursion Review.

Slides:



Advertisements
Similar presentations
Stacks and Queues. Not really data structures – More of an enforcement of policy – Can be implemented using an array or linked list – Can store just about.
Advertisements

CS252: Systems Programming Ninghui Li Program Interview Questions.
Stacks and Queues CSC220 Data Structure Winter
 Abstract Data Type Abstract Data Type  What is the difference? What is the difference?  Stacks Stacks  Stack operations Stack operations  Parsing.
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.
Chapter 3: Abstract Data Types Queues Lydia Sinapova, Simpson College Mark Allen Weiss: Data Structures and Algorithm Analysis in Java.
Fall 2007CS 2251 Iterators and Tree Traversals. Fall 2007CS 2252 Binary Trees In a binary tree, each node has at most two subtrees A set of nodes T is.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
CS 206 Introduction to Computer Science II 10 / 26 / 2009 Instructor: Michael Eckmann.
Data Structures, Spring 2004 © L. Joskowicz 1 DAST – Final Lecture Summary and overview What we have learned. Why it is important. What next.
CSE 326: Data Structures Lecture #0 Introduction Steve Wolfman Winter Quarter 2000.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
EXAM REVIEW CSC 172 SPRING 2004 LECTURE 26. Want to TA for next semester?
Agenda  See schedule  HW5 (mini-programming project) due Next Wed. 16th  Quiz 6 (double quiz- 50 minutes) will be Next Mon. 14th.
Algorithms and Data Structures Representing Sequences by Arrays and Linked Lists.
CSE 326: Data Structures Lecture #0 Introduction Bart Niswonger Summer Quarter 2001.
Java Collections. Collections, Iterators, Algorithms CollectionsIteratorsAlgorithms.
Lists, Stacks, Queues Svetlin Nakov Telerik Corporation
DS.L.1 Lists, Stacks, and Queues (Review) Chapter 3 Overview Abstract Data Types Linked Lists, Headers, Circular Links Cursor (Array) Implementation Stacks.
Computer Science: A Structured Programming Approach Using C1 6-9 Recursion In general, programmers use two approaches to writing repetitive algorithms.
Computer Science Department Data Structures and Algorithms Lecture 1.
ECE 103 Engineering Programming Chapter 61 Abstract Data Types Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Chapter 15: Advanced Topics: Introducing Data Structures and Recursion Visual Basic.NET Programming: From Problem Analysis to Program Design.
Information and Computer Sciences University of Hawaii, Manoa
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Stacks and Queues Data Structures & Problem Solving Using JAVA Second Edition Mark Allen Weiss Chapter 16 © 2002 Addison Wesley.
Data Structures and Algorithms – using JAVA Boro Jakimovski University of Sts Cyril and Methodius, Skopje.
Introducing Recursion Date: June 7 th, 2002 Author: Steve Engels, University of Waterloo.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
Cousin of the Stack.  An abstract data type (container class) in which items are entered at one end and removed from the other end  First In First.
1 Lecture 14: Queues Lecturer: Santokh Singh CompSci 105 SS 2005 Principles of Computer Science.
Java Methods Big-O Analysis of Algorithms Object-Oriented Programming
Data Structures academy.zariba.com 1. Lecture Content 1.Linear Data Structures 2.Trees and Graphs* 3.Dictionaries and Hash Tables 4.Homework 2.
Data Structures for Midterm 2. C++ Data Structure Runtimes.
CSE205 Review Session SAMUEL & JESSA. Recursion WHAT IS RECURSION?  Recursion is a tool a programmer can use to invoke a function call on itself. 
CS4710 Algorithms. What is an Algorithm? An algorithm is a procedure to perform some task. 1.General - applicable in a variety of situations 2.Step-by-step.
Chapter 12 Abstract Data Type. Understand the concept of an abstract data type (ADT). Understand the concept of a linear list as well as its operations.
Week 5 - Wednesday.  What did we talk about last time?  Recursion  Definitions: base case, recursive case  Recursive methods in Java.
Data-structure-palooza Checkout DataStructures from SVN.
April 27, 2017 COSC Data Structures I Review & Final Exam
Exam Review 2 Chapter 5 – 9 CSC212 FG CS Dept, CCNY.
Course Introductions.  Introduction to java  Basics of Java  Classes & Objects  Java Collections and APIs  Algorithms and their analysis  Recursion.
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.
Required Background for ECOE 556. What do I need to catch up with? Basic data structures (Chapter 10) –Stack –Queue –Linked list –Array –Records (e.g.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture3.
Introduction to Data Structure and Algorithms
Week 15 – Monday.  What did we talk about last time?  Tries.
Data Structures Intro2CS – week Stack ADT (Abstract Data Type) A container with 3 basic actions: – push(item) – pop() – is_empty() Semantics: –
Lecture 16 Stacks and Queues Richard Gesick. Sample test questions 1.Write a definition for a Node class that holds a number. 2.Write a method that sums.
Final Exam Review CS 3358.
Data Structures Interview Questions.
Data Structures and Algorithms
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 15 Lists Objectives
CS 315 Data Structures B. Ravikumar Office: 116 I Darwin Hall Phone:
Week 15 – Monday CS221.
Cse 373 April 26th – Exam Review.
Introduction to Computer Science - Alice
Data Structures and Algorithms
Exam 2 Review CS 3358 Data Structures.
Lecture 21 Stacks and Queues Richard Gesick.
Exam 2 Review CS 3358 Data Structures.
Exam 2 Review CS 3358 Data Structures.
Binary Tree Traversals
Stacks and Queues Prof. Michael Tsai 2017/02/21.
Chapter 19: Recursion.
Presentation transcript:

Lecture 2 Basic Data Structures and Recursion Review

Online Students Tell me what your plan is – in-class exam – proctoring

Participation 1 Blue Eyes Problem Due Thursday

Abstract Data Type Motivation – Grouping – Abstraction Definition

List Operations

List: array Characteristics Index calculation (constant)

List: array 1D array index calculation (constant)

List: array (cont’d) 2D array (RMO)

List: array (cont’d) 2D array (CMO)

List: array (cont’d) 3D array

List: array

Resizing: what’s the cost? Increase capacity by 1 Increase capacity by 100%

List: linked list Characteristics

List: doubly-linked list Characteristics

List: doubly-linked list

List: Circular linked list Characteristics

List: Circular linked list

List: Multi-List Characteristics

List: Multi-List

Stacks Operations

Stacks: arrays Push()

Stacks: arrays Pop()

Stacks: arrays

Stacks: linked lists Push()

Stacks: linked lists Pop()

Queues Characteristics

Queues: linked list enqueue

Queues: linked list dequeue

Queues: array enqueue

Queue: array dequeue

Dictionary Characteristics

Dictionary: implementations Hash Table B+ Trees

Other data structures Trees Graphs

Recursion Review Definition

Recursion Review Example: factorial

Recursion Review

Any recursive function can be rewritten as a loop.

Recursion Review Recursion vs loops

Recursion Review Reverse Linked List (iterative)

Recursion Review Reverse Linked List (recursive)

Recursion Review Reverse Linked List (recursive)

Recursion Review

Recursion Review: Towers of Hanoi image from wikipedia

Recursion Review: Towers of Hanoi image from mathworld.wolfram.com

Recursion Review Solving Towers of Hanoi Recursively

Lecture 2 Basic Data Structures and Recursion Review

Online Students Tell me what your plan is – in-class exam – proctoring

Participation 1 Blue Eyes Problem Due Thursday

Abstract Data Type Motivation – Grouping – Abstraction Definition

List Operations

List: array Characteristics Index calculation (constant)

List: array 1D array index calculation (constant)

List: array (cont’d) 2D array (RMO)

List: array (cont’d) 2D array (CMO)

List: array (cont’d) 3D array

List: array

Resizing: what’s the cost? Increase capacity by 1 Increase capacity by 100%

List: linked list Characteristics

List: doubly-linked list Characteristics

List: doubly-linked list

List: Circular linked list Characteristics

List: Circular linked list

List: Multi-List Characteristics

List: Multi-List

Stacks Operations

Stacks: arrays Push()

Stacks: arrays Pop()

Stacks: arrays

Stacks: linked lists Push()

Stacks: linked lists Pop()

Queues Characteristics

Queues: linked list enqueue

Queues: linked list dequeue

Queues: array enqueue

Queue: array dequeue

Dictionary Characteristics

Dictionary: implementations Hash Table B+ Trees

Other data structures Trees Graphs

Recursion Review Definition

Recursion Review Example: factorial

Recursion Review

Any recursive function can be rewritten as a loop.

Recursion Review Recursion vs loops

Recursion Review Reverse Linked List (iterative)

Recursion Review Reverse Linked List (recursive)

Recursion Review Reverse Linked List (recursive)

Recursion Review

Recursion Review: Towers of Hanoi image from wikipedia

Recursion Review: Towers of Hanoi image from mathworld.wolfram.com

Recursion Review Solving Towers of Hanoi Recursively