Unit 1: Preliminaries Part 1: Course Introduction, Abstraction, and ADT s

Size: px
Start display at page:

Download "Unit 1: Preliminaries Part 1: Course Introduction, Abstraction, and ADT s"

Transcription

1 Unit 1: Preliminaries Part 1: Course Introduction, Abstraction, and ADT s Engineering 4892: Data Structures Faculty of Engineering & Applied Science Memorial University of Newfoundland April 23, 2010 ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

2 1 Introduction What is this course about? Course outline Course notes 2 Abstraction 2 Modularity 2 Abstract Data Types (ADTs) Choosing between ADTs ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

3 What is this course about? Data structures...but what s a data structure? A data structure is a particular way of organizing computer memory to record some data e.g. an array The way in which data is organized can have a big impact on the efficiency of any operations on that data e.g. searching for a card in a sorted vs. unsorted deck The analysis of algorithms We can analyze an algorithm to predict how fast it will run as compared to another algorithm Recursion A recursive function is one which calls itself Can be very useful for solving certain problems ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

4 Course outline Preliminaries Abstraction Specification Review of pointers in C++ The Standard Template Library Complexity analysis Linked lists Stacks and queues Recursion Sorting Trees Graphs Hash tables ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

5 Course notes These notes will be posted to the course website. Some material will be presented on the blackboard and not provided in electronic format. It is your responsibility to take these notes down. Usually this will be clearly indicated in the electronic notes as follows: COVERED ON THE BOARD Sometimes, however, there will be other material presented in class, but not on the blackboard. Again, it is your responsibility to record this material. ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

6 Abstraction When we think about a topic, we usually consider it at one particular level of abstraction, e.g. to cross the street we think about the velocities of the cars and how to time our movement We abstract away the details of how the cars internal combustion engines and braking systems lead to their current velocities This process, called abstraction, allows us to deal with complex situations by abstracting away the details until the situation appears simple. When developing software, abstraction usually implies a separation between how a piece of software is used, and how it is implemented. In other words, abstraction means that we separate the interface from the implementation.

7 Consider the following function definition: // Returns the c h a r a c t e r f o l l o w i n g i n w i t h i n the // f i r s t 128 ASCII c h a r a c t e r s ( with wrap around ). char rotate ( char in ) ; The interface of a function includes the name, return type, and arguments, plus the specification of what that function does (i.e. the comments). Here is the function s implementation: char rotate ( char in ) { char out = ( in + 1) % 1 28; return out ; } In C++ we usually separate interface from implementation by putting the interface in a header file (.h file) and the implementation in another file (.cpp file). ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

8 Modularity Abstraction ties in with with the concept of modularity. Modularity means that the solution is broken up into modules or components. Modularity is crucial in software development. Why? Division of labour: Designing, implementing, testing and maintaining of components can be assigned to various individuals or groups Reuse and sale: The same components can be reused in multiple software systems; Components can be sold to other software developers When we have abstraction and modularity together, we separate the role of modules (given by their interfaces), from the details of their implementation. ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

9 Abstract Data Types (ADTs) A data type is a software component that stores some data and provides operations on that data. C++ captures this idea in its built-in data types (e.g. int, char, float,...) and in its classes. When the implementation of a data type is hidden from its user, we have an abstract data type or ADT. An ADT provides data abstraction. The separation between the use of an ADT and its implementation can be pictured as a wall:

10 Ultimately, the ADT is implemented using some data structure (e.g. a sorted array). However, the particular data structure used is hidden from the program that uses the ADT (a.k.a. client or user). Thus, data structures and ADT s are not the same thing! The ADT is the combination of the interface to the data and the data structure itself. What is the main mechanism for hiding implementation in C++ classes? private The user of an ADT interacts with it only through its interface, which in C++ is composed of a class s public members, as well as the specification for what those members do. Note: We may not actually hide the implementation. However, it is good practise to at least inform the user about the division between the interface and the implementation. ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

11 Consider the following two classes: class Complex1 { private : double magnitude, theta ; // t h e t a i n r a d i a n s. public : Complex1 operator +(Complex1 ) ; //... And so on... // } ; class Complex2 { private : double real, imaginary ; public : Complex2 operator +(Complex2 ) ; //... And so on... // } ; The implementation of Complex1 uses a polar representation, while Complex2 uses a cartesian representation. These classes have the same interface the public methods are all the same but they differ in their implementation.

12 Choosing between ADTs If you have two ADTs that differ only in implementation, how do you choose between them? Efficiency (a.k.a complexity) Time: The speed of the operations Space: The amount of space required in memory Cost of design and implementation (one time) Cost of maintanence (ongoing) Accuracy and predictability of representation: e.g. With either representation of Complex, it is unlikely that the complex number 1/3 is perfectly representable. ENGI 4892 (MUN) Unit 1, Part 1 April 23, / 12

Unit 1: Preliminaries Part 4: Introduction to the Standard Template Library

Unit 1: Preliminaries Part 4: Introduction to the Standard Template Library Unit 1: Preliminaries Part 4: Introduction to the Standard Template Library Engineering 4892: Data Structures Faculty of Engineering & Applied Science Memorial University of Newfoundland May 6, 2010 ENGI

More information

About this exam review

About this exam review Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review

More information

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR STUDENT IDENTIFICATION NO MULTIMEDIA COLLEGE JALAN GURNEY KIRI 54100 KUALA LUMPUR FIFTH SEMESTER FINAL EXAMINATION, 2014/2015 SESSION PSD2023 ALGORITHM & DATA STRUCTURE DSEW-E-F-2/13 25 MAY 2015 9.00 AM

More information

Hash Tables. CS 311 Data Structures and Algorithms Lecture Slides. Wednesday, April 22, Glenn G. Chappell

Hash Tables. CS 311 Data Structures and Algorithms Lecture Slides. Wednesday, April 22, Glenn G. Chappell Hash Tables CS 311 Data Structures and Algorithms Lecture Slides Wednesday, April 22, 2009 Glenn G. Chappell Department of Computer Science University of Alaska Fairbanks CHAPPELLG@member.ams.org 2005

More information

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay

Objects and Classes. Amirishetty Anjan Kumar. November 27, Computer Science and Engineering Indian Institue of Technology Bombay Computer Science and Engineering Indian Institue of Technology Bombay November 27, 2004 What is Object Oriented Programming? Identifying objects and assigning responsibilities to these objects. Objects

More information

Programming in C. main. Level 2. Level 2 Level 2. Level 3 Level 3

Programming in C. main. Level 2. Level 2 Level 2. Level 3 Level 3 Programming in C main Level 2 Level 2 Level 2 Level 3 Level 3 1 Programmer-Defined Functions Modularize with building blocks of programs Divide and Conquer Construct a program from smaller pieces or components

More information

CS24 Week 3 Lecture 1

CS24 Week 3 Lecture 1 CS24 Week 3 Lecture 1 Kyle Dewey Overview Some minor C++ points ADT Review Object-oriented Programming C++ Classes Constructors Destructors More minor Points (if time) Key Minor Points const Motivation

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 / Spring 209 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Prof. Amr Goneid Instructor: Prof. Amr Goneid E-mail: goneid@aucegypt.edu Office:

More information

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018 CSCE 20/220 Data Structures and Algorithms Prof. Amr Goneid Fall 208 CSCE 20/220 DATA STRUCTURES AND ALGORITHMS Dr. Amr Goneid Course Goals To introduce concepts of Data Models, Data Abstraction and ADTs

More information

Programming Abstractions

Programming Abstractions Programming Abstractions C S 1 0 6 B Cynthia Lee Topics: Priority Queue Linked List implementation Sorted Unsorted Heap structure implementation TODAY S TOPICS NOT ON THE MIDTERM 2 Some priority queue

More information

Standard. Number of Correlations

Standard. Number of Correlations Computer Science 2016 This assessment contains 80 items, but only 80 are used at one time. Programming and Software Development Number of Correlations Standard Type Standard 2 Duty 1) CONTENT STANDARD

More information

During the first 2 weeks of class, all students in the course will take an in-lab programming exam. This is the Exam in Programming Proficiency.

During the first 2 weeks of class, all students in the course will take an in-lab programming exam. This is the Exam in Programming Proficiency. Description of CPSC 301: This is a 2-unit credit/no credit course. It is a course taught entirely in lab, and has two required 2-hour 50-minute lab sessions per week. It will review, reinforce, and expand

More information

COEN244: Class & function templates

COEN244: Class & function templates COEN244: Class & function templates Aishy Amer Electrical & Computer Engineering Templates Function Templates Class Templates Outline Templates and inheritance Introduction to C++ Standard Template Library

More information

Data Structure. Recitation VII

Data Structure. Recitation VII Data Structure Recitation VII Recursion: Stack trace Queue Topic animation Trace Recursive factorial Executes factorial(4) Step 9: return 24 Step 8: return 6 factorial(4) Step 0: executes factorial(4)

More information

CS 216 Fall 2007 Midterm 1 Page 1 of 10 Name: ID:

CS 216 Fall 2007 Midterm 1 Page 1 of 10 Name:  ID: Page 1 of 10 Name: Email ID: You MUST write your name and e-mail ID on EACH page and bubble in your userid at the bottom of EACH page including this page and page 10. If you do not do this, you will receive

More information

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C CSE/IT 216 (CR) Total No. of Questions :09] [Total No. of Pages : 02 Time: Three Hours 1. a. ADT II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC- 2015 First Semester CSE/IT DATA STRUCTURES USING C Answer Question

More information

Data Structures and Algorithms. Chapter 1

Data Structures and Algorithms. Chapter 1 Data Structures Dr Ahmed Rafat Abas Computer Science Dept, Faculty of Computer and Information, Zagazig University arabas@zu.edu.eg http://www.arsaliem.faculty.zu.edu.eg/ Data Structures and Algorithms

More information

Types. C Types. Floating Point. Derived. fractional part. no fractional part. Boolean Character Integer Real Imaginary Complex

Types. C Types. Floating Point. Derived. fractional part. no fractional part. Boolean Character Integer Real Imaginary Complex Types C Types Void Integral Floating Point Derived Boolean Character Integer Real Imaginary Complex no fractional part fractional part 2 tj Types C Types Derived Function Array Pointer Structure Union

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Introduction to Object-Oriented Programming Objects and classes Abstract Data Types (ADT). Encapsulation OOP: Introduction 1 Pure Object-Oriented Languages Five rules [Source: Alan Kay]: Everything in

More information

CSCI-1200 Data Structures Fall 2018 Lecture 22 Hash Tables, part 2 & Priority Queues, part 1

CSCI-1200 Data Structures Fall 2018 Lecture 22 Hash Tables, part 2 & Priority Queues, part 1 Review from Lecture 21 CSCI-1200 Data Structures Fall 2018 Lecture 22 Hash Tables, part 2 & Priority Queues, part 1 the single most important data structure known to mankind Hash Tables, Hash Functions,

More information

B16 Object Oriented Programming

B16 Object Oriented Programming B16 Object Oriented Programming Michael A. Osborne mosb@robots.ox.ac.uk http://www.robots.ox.ac.uk/~mosb/teaching.html#b16 Hilary 2013 This course will introduce object-oriented programming (OOP). It will

More information

ENGINEERING PROBLEM SOLVING WITH C++

ENGINEERING PROBLEM SOLVING WITH C++ ENGINEERING PROBLEM SOLVING WITH C++ Second Edition Delores M. Etter Electrical Engineering Department United States Naval Academy Jeanine A. Ingber Training Consultant Sandia National Laboratories Upper

More information

Fibonacci in Lisp. Computer Programming: Skills & Concepts (CP1) Programming Languages. Varieties of Programing Language

Fibonacci in Lisp. Computer Programming: Skills & Concepts (CP1) Programming Languages. Varieties of Programing Language Fibonacci in Lisp Computer Programming: Skills & Concepts (CP1) Programming Languages (defun fibonacci (n) (if (or (= n 0) (= n 1)) 1 (+ (fibonacci (- n 1)) (fibonacci (- n 2))))) 22nd November 2010 defun-

More information

Computer Science 9608 (Notes) Chapter: 4.1 Computational thinking and problem-solving

Computer Science 9608 (Notes) Chapter: 4.1 Computational thinking and problem-solving In Computer Science, an abstract data type (ADT) is a mathematical model for a certain data type or structures. This doesn t mean that the ADTs cannot be programmed. But that we must first understand them

More information

Programming II. Modularity 2017/18

Programming II. Modularity 2017/18 Programming II Modularity 2017/18 Module? Lecture Outline Evolution and history of programming languages Modularity Example History of Programming Programming Paradigms How and why languages develop? How

More information

Abstract Data Types (ADT) and C++ Classes

Abstract Data Types (ADT) and C++ Classes Abstract Data Types (ADT) and C++ Classes 1-15-2013 Abstract Data Types (ADT) & UML C++ Class definition & implementation constructors, accessors & modifiers overloading operators friend functions HW#1

More information

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully. UNIVERSITY OF TORONTO FACULTY OF APPLIED SCIENCE AND ENGINEERING FINAL EXAMINATION, APRIL 2017 CSC 190 HIS - COMPUTER ALGORITHMS AND DATA STRUCTURES Exam Type: A NO calculator allowed Duration: 2.5 hours

More information

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object CHAPTER 1 Introduction to Computers and Programming 1 1.1 Why Program? 1 1.2 Computer Systems: Hardware and Software 2 1.3 Programs and Programming Languages 8 1.4 What is a Program Made of? 14 1.5 Input,

More information

CS113: Lecture 4. Topics: Functions. Function Activation Records

CS113: Lecture 4. Topics: Functions. Function Activation Records CS113: Lecture 4 Topics: Functions Function Activation Records 1 Why functions? Functions add no expressive power to the C language in a formal sense. Why have them? Breaking tasks into smaller ones make

More information

An OBJECT contains VARIABLES = PROPERTIES and METHODS = BEHAVIORS. Outline the general nature of an object.

An OBJECT contains VARIABLES = PROPERTIES and METHODS = BEHAVIORS. Outline the general nature of an object. D Object oriented programming Notes by Dave Mulkey, 2015, Germany D.1 Objects as a programming concept (6 hours) The paradigm of object oriented programming should be introduced through discussion and

More information

Time : 03 Hours Maximum Marks : 75

Time : 03 Hours Maximum Marks : 75 (DMSIT 01) Information Technology Paper - I : BASICS OF INFORMATION TECHNOLOGY Answer any Three of the following 1) Define IT. Enumerate various IT trends and their benefits to the organizations. 2) Bring

More information

Introduction to Programming (Java) 4/12

Introduction to Programming (Java) 4/12 Introduction to Programming (Java) 4/12 Michal Krátký Department of Computer Science Technical University of Ostrava Introduction to Programming (Java) 2008/2009 c 2006 2008 Michal Krátký Introduction

More information

Unit 4: Stacks and Queues

Unit 4: Stacks and Queues Unit 4: Stacks and Queues Engineering 4892: Data Structures Faculty of Engineering & Applied Science Memorial University of Newfoundland June 1, 2011 ENGI 4892 (MUN) Unit 4 June 1, 2011 1 / 24 1 Stacks

More information

Data structures and libraries

Data structures and libraries Data structures and libraries Bjarki Ágúst Guðmundsson Tómas Ken Magnússon Árangursrík forritun og lausn verkefna School of Computer Science Reykjavík University Today we re going to cover Basic data types

More information

What is an algorithm?

What is an algorithm? Reminders CS 142 Lecture 4 ADTs & Objects Program 1 was assigned - Due on 1/27 by 11:55pm Spring 2015 2 Object-Oriented Programming (OOP) OOP Definitions Imagine: You and your programming team have written

More information

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst Department of Computer Science Why C? Low-level Direct access to memory WYSIWYG (more or less) Effectively

More information

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee 1 0 1 0 Foundation Topics 1 0 Chapter 1 - Introduction to Programming 1 1 Systems Development Life Cycle N/A N/A N/A N/A N/A N/A 1-8 12-13 1 2 Bloodshed Dev-C++ 5 Compiler/IDE N/A N/A N/A N/A N/A N/A N/A

More information

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers) Review Final exam Final exam will be 12 problems, drop any 2 Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers) 2 hours exam time, so 12 min per problem (midterm 2 had

More information

CS300 Final Review Questions 1

CS300 Final Review Questions 1 CS300 Final Review Questions 1 This is not a complete list of questions and topics, but a good sampling of questions that will help you study for the final. I strongly advise you to work through every

More information

Computational thinking, problem-solving and programming:

Computational thinking, problem-solving and programming: Computational thinking, problem-solving and programming: Connecting computational thinking and program design IB Computer Science Content developed by Dartford Grammar School Computer Science Department

More information

Chapter 8 Algorithms 1

Chapter 8 Algorithms 1 Chapter 8 Algorithms 1 Objectives After studying this chapter, the student should be able to: Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms.

More information

PROBLEM 1 : (And the winner is...(12 points)) Assume you are considering the implementation of a priority queue that will always give you the smallest

PROBLEM 1 : (And the winner is...(12 points)) Assume you are considering the implementation of a priority queue that will always give you the smallest CPS 100, Ramm Hour Exam #2 (11/1/99) Fall, 1999 NAME (print): Honor Acknowledgment (signature): DO NOT SPEND MORE THAN 10 OR SO MINUTES ON ANY OF THE OTHER QUESTIONS! If you don't see the solution to a

More information

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java

More information

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C Practical -1 Babaria Institute of Technology LEARN CONCEPTS OF OOP 1. Explain Object Oriented Paradigm with figure. 2. Explain basic Concepts of OOP with example a. Class b. Object c. Data Encapsulation

More information

END TERM EXAMINATION

END TERM EXAMINATION END TERM EXAMINATION THIRD SEMESTER [BCA] DECEMBER 2007 Paper Code: BCA 209 Subject: Object Oriented Programming Time: 3 hours Maximum Marks: 75 Note: Attempt all questions. Internal choice is indicated.

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

CPSC 2380 Data Structures and Algorithms

CPSC 2380 Data Structures and Algorithms CPSC 2380 Data Structures and Algorithms Spring 2014 Department of Computer Science University of Arkansas at Little Rock 2801 South University Avenue Little Rock, Arkansas 72204-1099 Class Hours: Tuesday

More information

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \

1 P a g e A r y a n C o l l e g e \ B S c _ I T \ C \ BSc IT C Programming (2013-2017) Unit I Q1. What do you understand by type conversion? (2013) Q2. Why we need different data types? (2013) Q3 What is the output of the following (2013) main() Printf( %d,

More information

Module 1: Asymptotic Time Complexity and Intro to Abstract Data Types

Module 1: Asymptotic Time Complexity and Intro to Abstract Data Types Module 1: Asymptotic Time Complexity and Intro to Abstract Data Types Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu

More information

Link-Based Implementations. Chapter 4

Link-Based Implementations. Chapter 4 Link-Based Implementations Chapter 4 Overview Assignment-2 Slack code puzzle Negative time durations Both -1:59:59 and -0:00:01 are OK to represent -1 seconds Slack no assignment code posting Code Puzzle

More information

Lecture 2: Implementing ADTs

Lecture 2: Implementing ADTs Lecture 2: Implementing ADTs Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1 Warm Up Discuss with your neighbors! From last lecture: - What is an ADT? - What is a data structure? From CSE

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

More information

Objectives. Order (sort) the elements of an array Search an array for a particular item Define, use multidimensional array

Objectives. Order (sort) the elements of an array Search an array for a particular item Define, use multidimensional array Arrays Chapter 7 Objectives Nature and purpose of an array Using arrays in Java programs Methods with array parameter Methods that return an array Array as an instance variable Use an array not filled

More information

ADTs, Arrays, Linked Lists

ADTs, Arrays, Linked Lists 1 ADTs, Arrays, Linked Lists Outline and Required Reading: ADTs ( 2.1) Using Arrays ( 3.1) Linked Lists ( 3.2, 3.3, 3.4) CSE 2011, Winter 2017 Instructor: N. Vlajic Data Type 2 A data type is a classification

More information

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Table of Contents. Chapter 1: Introduction to Data Structures... 1 Table of Contents Chapter 1: Introduction to Data Structures... 1 1.1 Data Types in C++... 2 Integer Types... 2 Character Types... 3 Floating-point Types... 3 Variables Names... 4 1.2 Arrays... 4 Extraction

More information

Assignment 5: Priority Queue

Assignment 5: Priority Queue Assignment 5: Priority Queue Topic(s): Priority Queues, Code Reusability, More Advanced Makefiles, Debugging, Testing Date assigned: Wednesday, October 18, 2017 Date due: Wednesday, November 1, 2017, 9:15

More information

Data Structures and Algorithm Analysis in C++

Data Structures and Algorithm Analysis in C++ INTERNATIONAL EDITION Data Structures and Algorithm Analysis in C++ FOURTH EDITION Mark A. Weiss Data Structures and Algorithm Analysis in C++, International Edition Table of Contents Cover Title Contents

More information

Introduction to Data Structures & Algorithm

Introduction to Data Structures & Algorithm Introduction to Data Structures & Algorithm Objectives: By the end of the class, students are expected to understand the following: n data structure and algorithm concept n programming development paradigm

More information

Programming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras

Programming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Programming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 13 Merging using Queue ADT and Queue types In the

More information

! Mon, May 5, 2:00PM to 4:30PM. ! Closed book, closed notes, clean desk. ! Comprehensive (covers entire course) ! 30% of your final grade

! Mon, May 5, 2:00PM to 4:30PM. ! Closed book, closed notes, clean desk. ! Comprehensive (covers entire course) ! 30% of your final grade Final Exam Review Final Exam Mon, May 5, 2:00PM to 4:30PM CS 2308 Spring 2014 Jill Seaman Closed book, closed notes, clean desk Comprehensive (covers entire course) 30% of your final grade I recommend

More information

Web Development I PRECISION EXAMS DESCRIPTION. EXAM INFORMATION Items

Web Development I PRECISION EXAMS DESCRIPTION. EXAM INFORMATION Items PRECISION EXAMS Web Development I EXAM INFORMATION Items 43 Points 62 Prerequisites NONE Grade Level 9-12 Course Length ONE YEAR Career Cluster INFORMATION TECHNOLOGY Performance Standards INCLUDED Certificate

More information

CS125 : Introduction to Computer Science. Lecture Notes #38 and #39 Quicksort. c 2005, 2003, 2002, 2000 Jason Zych

CS125 : Introduction to Computer Science. Lecture Notes #38 and #39 Quicksort. c 2005, 2003, 2002, 2000 Jason Zych CS125 : Introduction to Computer Science Lecture Notes #38 and #39 Quicksort c 2005, 2003, 2002, 2000 Jason Zych 1 Lectures 38 and 39 : Quicksort Quicksort is the best sorting algorithm known which is

More information

Programming Assignment #4 Binary Trees in C++

Programming Assignment #4 Binary Trees in C++ Programming Assignment #4 Binary Trees in C++ Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2 nd edition, by Kernighan and Ritchie,

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 11 Introduction to Computing II Wayne Snyder Department Boston University Today Object-Oriented Programming Concluded Stacks, Queues, and Priority Queues as Abstract Data Types Reference types: Basic

More information

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright

Java Basics. Object Orientated Programming in Java. Benjamin Kenwright Java Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Java Concepts Syntax, Grammar, Formatting, Introduce Object-Orientated Concepts Encapsulation, Abstract Data, OO Languages,

More information

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005 Lecture 8 Classes and Objects Part 2 MIT AITI June 15th, 2005 1 What is an object? A building (Strathmore university) A desk A laptop A car Data packets through the internet 2 What is an object? Objects

More information

More loops Ch

More loops Ch More loops Ch 3.3-3.4 Announcements Quiz next week! -Covers up to (and including) HW1 (week 1-3) -Topics: cout/cin, types, scope, if/else, etc. Review: Loops We put a loop around code that we want to run

More information

CS 32. Lecture 2: objects good?

CS 32. Lecture 2: objects good? CS 32 Lecture 2: objects good? Double Vision This course has two main tracks Unix/shell stuff Object-Oriented Programming Basic C++ familiarity Off by one! Another Troika This class has three main texts

More information

COLLEGE OF THE DESERT

COLLEGE OF THE DESERT COLLEGE OF THE DESERT Course Code CS-009 Course Outline of Record 1. Course Code: CS-009 2. a. Long Course Title: Data Structures and Algorithms b. Short Course Title: DATA STRUCTURES 3. a. Catalog Course

More information

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

Modularity. Modular program development. Language support for modularity. Step-wise refinement Interface, specification, and implementation

Modularity. Modular program development. Language support for modularity. Step-wise refinement Interface, specification, and implementation Modular program development Step-wise refinement Interface, specification, and implementation Language support for modularity Procedural abstraction Abstract data types Packages and modules Generic abstractions

More information

Hash Open Indexing. Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1

Hash Open Indexing. Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1 Hash Open Indexing Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1 Warm Up Consider a StringDictionary using separate chaining with an internal capacity of 10. Assume our buckets are implemented

More information

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 03 From Programs to Processes Hello. In

More information

Inheritance and Substitution (Budd chapter 8, 10)

Inheritance and Substitution (Budd chapter 8, 10) Inheritance and Substitution (Budd chapter 8, 10) 1 2 Plan The meaning of inheritance The syntax used to describe inheritance and overriding The idea of substitution of a child class for a parent The various

More information

Chapter 3: Modules. Starting Out with Programming Logic & Design. Second Edition. by Tony Gaddis

Chapter 3: Modules. Starting Out with Programming Logic & Design. Second Edition. by Tony Gaddis Chapter 3: Modules Starting Out with Programming Logic & Design Second Edition by Tony Gaddis Copyright 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter Topics 3.1 Introduction

More information

CS 223: Data Structures and Programming Techniques. Exam 2. April 19th, 2012

CS 223: Data Structures and Programming Techniques. Exam 2. April 19th, 2012 CS 223: Data Structures and Programming Techniques. Exam 2 April 19th, 2012 Instructor: Jim Aspnes Work alone. Do not use any notes or books. You have approximately 75 minutes to complete this exam. Please

More information

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018) Lesson Plan Name of the Faculty Discipline Semester :Mrs. Reena Rani : Computer Engineering : IV Subject: OBJECT ORIENTED PROGRAMMING USING C++ Lesson Plan Duration :15 weeks (From January, 2018 to April,2018)

More information

Supplementary Material: The Rotation Matrix

Supplementary Material: The Rotation Matrix Supplementary Material: The Rotation Matrix Computer Science 4766/6778 Department of Computer Science Memorial University of Newfoundland January 16, 2014 COMP 4766/6778 (MUN) The Rotation Matrix January

More information

CS24 Week 4 Lecture 2

CS24 Week 4 Lecture 2 CS24 Week 4 Lecture 2 Kyle Dewey Overview Linked Lists Stacks Queues Linked Lists Linked Lists Idea: have each chunk (called a node) keep track of both a list element and another chunk Need to keep track

More information

OOP Design Conclusions and Variations

OOP Design Conclusions and Variations CS108, Stanford Handout #20 Fall, 2008-09 Osvaldo Jiménez OOP Design Conclusions and Variations Thanks to Nick Parlante for much of this handout Part 1 -- Mainstream OOP Design First, we have the standard,

More information

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites: C Programming Code: MBD101 Duration: 10 Hours Prerequisites: You are a computer science Professional/ graduate student You can execute Linux/UNIX commands You know how to use a text-editing tool You should

More information

Computer Science 210: Data Structures

Computer Science 210: Data Structures Computer Science 210: Data Structures Welcome to Data Structures! Data structures are fundamental building blocks of algorithms and programs Csci 210 is a study of data structures design efficiency implementation

More information

C++ Data Types. 1 Simple C++ Data Types 2. 3 Numeric Types Integers (whole numbers) Decimal Numbers... 5

C++ Data Types. 1 Simple C++ Data Types 2. 3 Numeric Types Integers (whole numbers) Decimal Numbers... 5 C++ Data Types Contents 1 Simple C++ Data Types 2 2 Quick Note About Representations 3 3 Numeric Types 4 3.1 Integers (whole numbers)............................................ 4 3.2 Decimal Numbers.................................................

More information

Abstract Data Types. Functional Programming and Reasoning. Dr Hans Georg Schaathun. University of Surrey. Spring 2010 Week 4

Abstract Data Types. Functional Programming and Reasoning. Dr Hans Georg Schaathun. University of Surrey. Spring 2010 Week 4 Abstract Data Types Functional Programming and Reasoning Dr Hans Georg Schaathun University of Surrey Spring 2010 Week 4 Dr Hans Georg Schaathun Abstract Data Types Spring 2010 Week 4 1 / 32 Outline 1

More information

Algorithms & Data Structures

Algorithms & Data Structures GATE- 2016-17 Postal Correspondence 1 Algorithms & Data Structures Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key

More information

Abstract Data Structures IB Computer Science. Content developed by Dartford Grammar School Computer Science Department

Abstract Data Structures IB Computer Science. Content developed by Dartford Grammar School Computer Science Department Abstract Data Structures IB Computer Science Content developed by Dartford Grammar School Computer Science Department HL Topics 1-7, D1-4 1: System design 2: Computer Organisation 3: Networks 4: Computational

More information

QUIZ How do we implement run-time constants and. compile-time constants inside classes?

QUIZ How do we implement run-time constants and. compile-time constants inside classes? QUIZ How do we implement run-time constants and compile-time constants inside classes? Compile-time constants in classes The static keyword inside a class means there s only one instance, regardless of

More information

ACCESSIBILITY TIPS. Adding alternative text to images and objects in PowerPoint or Word

ACCESSIBILITY TIPS. Adding alternative text to images and objects in PowerPoint or Word ACCESSIBILITY TIPS To make your PowerPoints and Word documents accessible, you will need to Add alternative text to images and objects Ensure that all slides have unique titles Include closed captions

More information

CSE 100 Advanced Data Structures

CSE 100 Advanced Data Structures CSE 100 Advanced Data Structures Overview of course requirements Outline of CSE 100 topics Review of trees Helpful hints for team programming Information about computer accounts Page 1 of 25 CSE 100 web

More information

CSCI 253. Outline. Background. George Blankenship 1

CSCI 253. Outline. Background. George Blankenship 1 CSCI 253 Object Oriented Design: Object Oriented Design and Programming in Java George Blankenship George Blankenship 1 Outline Background Rationale for the course Why object oriented programming? OOP

More information

SERIOUS ABOUT SOFTWARE. Qt Core features. Timo Strömmer, May 26,

SERIOUS ABOUT SOFTWARE. Qt Core features. Timo Strömmer, May 26, SERIOUS ABOUT SOFTWARE Qt Core features Timo Strömmer, May 26, 2010 1 Contents C++ refresher Core features Object model Signals & slots Event loop Shared data Strings Containers Private implementation

More information

Lecture 2: Stacks and Queues

Lecture 2: Stacks and Queues Lecture 2: Stacks and Queues CSE 373: Data Structures and Algorithms CSE 373 19 WI - KASEY CHAMPION 1 Warm Up 1. Grab a worksheet 2. Introduce yourself to your neighbors J 3. Discuss the answers 4. Log

More information

DATA ABSTRACTION AND PROBLEM SOLVING WITH JAVA

DATA ABSTRACTION AND PROBLEM SOLVING WITH JAVA DATA ABSTRACTION AND PROBLEM SOLVING WITH JAVA WALLS AND MIRRORS First Edition Frank M. Carrano University of Rhode Island Janet J. Prichard Bryant College Boston San Francisco New York London Toronto

More information

The Software Design Process. CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed

The Software Design Process. CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed The Software Design Process CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed Outline Challenges in Design Design Concepts Heuristics Practices Challenges in Design A problem that can only be defined

More information

Data Structure (CS301)

Data Structure (CS301) WWW.VUPages.com http://forum.vupages.com WWW.VUTUBE.EDU.PK Largest Online Community of VU Students Virtual University Government of Pakistan Midterm Examination Spring 2003 Data Structure (CS301) StudentID/LoginID

More information

Algorithms. Chapter 8. Objectives After studying this chapter, students should be able to:

Algorithms. Chapter 8. Objectives After studying this chapter, students should be able to: Objectives After studying this chapter, students should be able to: Chapter 8 Algorithms Define an algorithm and relate it to problem solving. Define three construct and describe their use in algorithms.

More information

CSCE 110 PROGRAMMING FUNDAMENTALS

CSCE 110 PROGRAMMING FUNDAMENTALS CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 15. Dictionaries (1): A Key Table Class Prof. amr Goneid, AUC 1 Dictionaries(1): A Key Table Class Prof. Amr Goneid, AUC 2 A Key Table

More information

CSE 374 Programming Concepts & Tools. Hal Perkins Spring 2010

CSE 374 Programming Concepts & Tools. Hal Perkins Spring 2010 CSE 374 Programming Concepts & Tools Hal Perkins Spring 2010 Lecture 19 Introduction ti to C++ C++ C++ is an enormous language: g All of C Classes and objects (kind of like Java, some crucial differences)

More information

Standard ADTs. Lecture 19 CS2110 Summer 2009

Standard ADTs. Lecture 19 CS2110 Summer 2009 Standard ADTs Lecture 19 CS2110 Summer 2009 Past Java Collections Framework How to use a few interfaces and implementations of abstract data types: Collection List Set Iterator Comparable Comparator 2

More information

CS2102, B11 Exam 1. Name:

CS2102, B11 Exam 1. Name: CS2102, B11 Exam 1 Name: You have 50 minutes to complete the problems on the following pages. There should be sufficient space provided for your answers. If a problem asks you to create a class hierarchy,

More information