April 27, 2017 COSC Data Structures I Review & Final Exam

Slides:



Advertisements
Similar presentations
Stacks, Queues, and Linked Lists
Advertisements

Stack & Queues COP 3502.
Min Chen School of Computer Science and Engineering Seoul National University Data Structure: Chapter 4.
CSC 212 – Data Structures. Using Stack Stack Limitations  Great for Pez dispensers, JVMs,& methods  All of these use most recent item added only 
CS Data Structures II Review COSC 2006 April 14, 2017
© 2006 Pearson Addison-Wesley. All rights reserved5 A-1 Chapter 5 Linked Lists CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck Spring 2008.
Circular Arrays Neat trick: use a circular array to insert and remove items from a queue in constant time The idea of a circular array is that the end.
Chapter 3 Stacks.
Stacks Chapter 5. Chapter 5: Stacks2 Chapter Objectives To learn about the stack data type and how to use its four methods: push, pop, peek, and empty.
© 2006 Pearson Addison-Wesley. All rights reserved8-1 Chapter 8 Queues CS102 Sections 51 and 52 Marc Smith and Jim Ten Eyck Spring 2008.
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.
© 2006 Pearson Addison-Wesley. All rights reserved7A-1 Chapter 7 Stacks.
CS102 – Data Structures Lists, Stacks, Queues, Trees, Hash Collections Framework David Davenport Spring 2002.
CHAPTER 6 Stacks Array Implementation. 2 Stacks A stack is a linear collection whose elements are added and removed from one end The last element to be.
Chapter 12 C Data Structures Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
Stack: Linked List Implementation Push and pop at the head of the list New nodes should be inserted at the front of the list, so that they become the top.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 – Data Structures Outline 12.1Introduction.
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.
Algorithms and Data Structures Representing Sequences by Arrays and Linked Lists.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Objectives of these slides:
DS.L.1 Lists, Stacks, and Queues (Review) Chapter 3 Overview Abstract Data Types Linked Lists, Headers, Circular Links Cursor (Array) Implementation Stacks.
Chapter 7 Stacks II CS Data Structures I COSC 2006
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
ISOM MIS 215 Module 3 – Stacks and Queues. ISOM Where are we? 2 Intro to Java, Course Java lang. basics Arrays Introduction NewbieProgrammersDevelopersProfessionalsDesigners.
© 2006 Pearson Addison-Wesley. All rights reserved8 A-1 Chapter 8 Queues (slightly modified by Dan Fleck)
DATA STRUCTURES AND ALGORITHMS Lecture Notes 4 Prepared by İnanç TAHRALI.
Information and Computer Sciences University of Hawaii, Manoa
Chapter 7 Stacks. © 2004 Pearson Addison-Wesley. All rights reserved 7-2 The Abstract Data Type: Developing an ADT During the Design of a Solution Specifications.
Week 3 – Wednesday.  What did we talk about last time?  ADTs  List implementation with a dynamic array.
© 2006 Pearson Addison-Wesley. All rights reserved8 A-1 Chapter 8 Queues.
CSE 373: Data Structures and Algorithms Lecture 1: Introduction; ADTs; Stacks; Eclipse.
30 May Stacks (5.1) CSE 2011 Winter Stacks2 Abstract Data Types (ADTs) An abstract data type (ADT) is an abstraction of a data structure An.
LECTURE 26: QUEUES CSC 212 – Data Structures. Using Stack.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture6.
CS Data Structures II Review & Final Exam. 2 Topics Review Final Exam.
Chapter 8 Queue I CS Data Structures I COSC2006 April 24, 2017
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
1 Linked-list, stack and queue. 2 Outline Abstract Data Type (ADT)‏ Linked list Stack Queue.
1 Lecture 14: Queues Lecturer: Santokh Singh CompSci 105 SS 2005 Principles of Computer Science.
Question of the Day  Three people check into a hotel for which they pay the manager $30. The manager finds out the rate is $25 and gives $5 to the bellboy.
Chapter 5 Linked Lists II
Chapter 8 Queues. © 2004 Pearson Addison-Wesley. All rights reserved 8-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear, of.
CS Data Structures I Chapter 7 Queue I. 2 Topics Introduction Queue Application Implementation Linked List Array ADT List.
Question of the Day  How can you change the position of 1 toothpick and leave the giraffe in exactly the same form, but possibly mirror-imaged or oriented.
© 2006 Pearson Addison-Wesley. All rights reserved5 B-1 Chapter 5 (continued) Linked Lists.
CS2006- Data Structures I Chapter 5 Linked Lists III.
Chapter 5 Linked Lists. © 2004 Pearson Addison-Wesley. All rights reserved 5 A-2 Preliminaries Options for implementing an ADT –Array Has a fixed size.
Understanding General Software Development Lesson 3.
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
Lecture 8: Advanced OOP Part 2. Overview Review of Subtypes Interfaces Packages Sorting.
Question of the Day  How can you change the position of 1 toothpick and leave the giraffe in exactly the same form, but possibly mirror-imaged or oriented.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
3/3/20161 Stacks and Queues Introduction to Data Structures Ananda Gunawardena.
Exam 2 Review CS 3358 Data Structures. 90 Total Points – 50 Points Writing Programs – 25 Points Tracing Algorithms, determining results, and drawing pictures.
Chapter 7 A Queues. © 2004 Pearson Addison-Wesley. All rights reserved7 A-2 The Abstract Data Type Queue A queue –New items enter at the back, or rear,
Stacks Chapter 3 Objectives Upon completion you will be able to
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture3.
Final Exam Review CS 3358.
Data Structure By Amee Trivedi.
G64ADS Advanced Data Structures
Introduction to Computers Computer Generations
CSE 373: Data Structures and Algorithms
Building Java Programs
CMSC 341 Lecture 5 Stacks, Queues
CS 2308 Final Exam Review.
The List, Stack, and Queue ADTs
Stack A data structure in which elements are inserted and removed only at one end (called the top). Enforces Last-In-First-Out (LIFO) Uses of Stacks Evaluating.
Chapter 8 Queues © 2006 Pearson Addison-Wesley. All rights reserved.
CS 2308 Final Exam Review.
Presentation transcript:

COSC2006 - Data Structures I April 27, 2017 COSC2006 - Data Structures I Review & Final Exam Chapter 9: Algorithms & Efficiency

Topics Review Final Exam

Review Software Engineering Problem Solving Software Life Cycle Modular Design OO Design Top Down Design Structure Chart

Review Recursion Recursion and Iteration Recursion Examples How to trace recursion Run-time Stack Recursion Problem

Review ADT Concepts How to define a ADT? Array-based ADT List

Review Linked List Comparison with Array Object & Reference Referenced-based LL LL operations: Insertion Deletion Traverse LL-based ADT List Variation of LL Doubly LL

Review Stack Characteristics of ADT Stack Stack Applications Bracket balancing Stack operations Stack implementation Array-based LL-based ADT List-based More Detail Examples Evaluating postfix, prefix Convert from infix to postfix

Review Queue Characteristics of ADT Queue Queue Applications Convert digit to decimal Palindrome Queue operations Queue implementation Array-based LL-based ADT List-based

Review Efficiency Big-O Searching Sorting Linear search Binary Search Three O(n2) Bubble sort Insertion sort Selection sort

Review Efficiency Sorting Merge Sort Quick Sort Radix Sort

Review Which of the following is a base case for a recursive binary search algorithm? (first is the index of the first item in the array, last is the index of the last item in the array, and mid is the midpoint of the array). last > first first > last 0 <= first last <= SIZE-1

Review A recursive binary search algorithm always reduces the problem size by ______ at each recursive call. 1 2 half one-third

Review An array is a(n) ______. class method object variable

Review An ADT’s ______ govern(s) what its operations are and what they do. specifications implementation documentation data structure

Review The insertion operation of the ADT list can insert new items ______. only at the front of the list only at the end of the list only in the middle of the list into any position of the list

Review Which of the following is true about a constructor in Java? all constructors have a return type of void a constructor cannot have parameters a constructor has the same name as the class a class can only have a single constructor

Review The ______ keyword is used to call the constructor of the superclass. extends super this implements

Review When you declare a variable that refers to an object of a given class, you are creating a(n) ______ to the object. interface reference Method ADT

Review A reference variable whose sole purpose is to locate the first node in a linked list is called ______. top front head first

Review Which of the following statements deletes the node that curr references? prev.setNext(curr); curr.setNext(prev); curr.setNext(curr.getNext()); prev.setNext(curr.getNext());

Review An array-based implementation of an ADT list ______. requires less memory to store an item than a reference-based implementation is not a good choice for a small list has a variable size has items which explicitly reference the next items

Review If the array: 6, 2, 7, 13, 5, 4 is added to a stack, in the order given, which number will be the first number to be removed from the stack? 6 2 5 4

Review Which of the following methods of the ADT stack accepts a parameter? push pop createStack peek

Review Typically, ______ are used by a compiler to implement recursive methods. linked-lists arrays Stacks queues

Review A reference-based implementation of a queue that uses a linear linked list would need at least ______ external references. one two three four

Review Which of the following methods of QueueInterface does NOT throw a QueueException? enqueue dequeue dequeueAll peek

Review The Java ______ operator is used to obtain the wraparound effect of a circular array-based queue. * + % /

Review If a queue is implemented as the ADT list, which of the following queue operations can be implemented as list.remove(1)? enqueue() dequeue() isEmpty() peek()

Final Exam Topics No specific questions from chapter 1 & 2 All other parts you have learned in class Chapter 3, 4, 5, 7, 8, 10 Class Notes Tutorials (the solutions are on-line) Assignments

Final Exam Time: Wednesday, Dec 16, 2:00 pm Place: EW206 Format 20 multiple choices (30%) Short Answer Questions (~40%) Programming Questions (~30%)