# Cpt S 223. School of EECS, WSU

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Abstract Data Types 1

2 Topics Abstract Data Types (ADTs) Some basic ADTs: Lists Stacks Queues 2

3 Primitive Data Type vs. Abstract Data Types Primitive DT: ADT: programmer progra ammer Interface (API) e.g., int, float Implementation (methods) Data 3

4 Abstract Data Types (ADTs) ADT is a set of objects together with a set of operations. Abstract in that implementation of operations not specified in ADT definition E.g., List Insert, delete, search, sort C++ classes are perfect for ADTs Can change ADT implementation details without breaking code using ADT 4

5 Specifications of basic ADTs List, Stack, Queue 5

6 The List ADT List of size N: A 0, A 1,, A N-1 Each element A k has a unique position k in the list Elements can be arbitrarily complex Operations insert(x,k), remove(k), find(x), findkth(k), printlist() 6

7 Stack ADT Stack = a list where insert and remove take place only at the top Operations Push (insert) element e e on top of stack Pop (remove) element from top of stack Top: return element at top of stack LIFO (Last In First Out) 7

8 Queue ADT Queue = a list where insert takes place at the back, but remove takes place at the front Operations Enqueue (insert) element at the back of the queue Dequeue (remove and return) element from the front of the queue FIFO (First In First Out) Dequeue here Enque here front back 8

9 Implementation ti for basic ADTs 9

10 List ADT using Arrays A 0 A 1 A 2 A 3 Operations Read as order N insert(x,k) : O(N) remove(k) : O(N) find(x) : O(N) findkth(k) (): O(1) printlist() : O(N) (means that t runtime is proportional to N) Read as order 1 (means that runtime is a constant i.e., not dependent on N) 10

11 List ADT using Linked Lists Elements not stored in contiguous memory Nodes in list consist of data element and next pointer node data next pointer null 11

12 Linked Lists Operations Insert(X,A) O(1) Remove(A) O(1) 12

13 Linked Lists Operations find(x) O(N) findkth(k) O(N) printlist() O(N) 13

14 Doubly-Linked List Singly-linked list insert(x,a) and remove(x) require pointer to node just before X Doubly-linked linked list Also keep pointer to previous node prev next 14

15 Doubly-Linked List Insert(X,A) Remove(X) newa = new Node(A); newa->prev = X->prev; newa->next = X; X->prev->next = newa; X->prev = newa; X->prev->next = X->next; X->next->prev = X->prev; Problems with operations at ends of list 15

16 Sentinel Nodes Dummy head and tail nodes to avoid special cases at ends of list Doubly-linked linked list with sentinel nodes Empty doubly-linked li d list with sentinel nodes 16

17 C++ Standard Template Library (STL) Implementation of common data structures List, stack, queue, Generally called containers WWW references for STL l 17

18 Implementing Lists using STL vector<object> Array-based implementation findkth O(1) insert and remove O(N) Unless change at end of vector list<object> Doubly-linked list with sentinel nodes findkth O(N) insert and remove O(1) If position of change is known Both require O(N) for search 18

19 Container Methods int size() const Return number of elements in container void clear() Remove all elements from container bool empty() Return true is container has no elements, otherwise returns false 19

20 Vector and List Methods void push_back (const Object & x) Add x to end of list void pop_back () Remove object at end of list const Object & back () const Return object at end of list const Object & front () const Return object at front of list 20

21 List-only Methods void push_front (const Object & x) Add x to front of list void pop_front () Remove object at front of list 21

22 Vector-only Methods Object & operator[] (int idx) Return object at index idx in vector with no bounds-checking Object & at (int idx) Return object at index idx in vector with boundschecking int capacity () const Return internal capacity of vector void reserve (int newcapacity) Set new capacity for vector (avoid expansion) 22

23 Iterators Represents position in container Getting an iterator iterator begin () Return appropriate iterator representing first item in container iterator end () Return appropriate iterator representing end marker in container Position after last item in container 23

24 Iterator Methods itr++ and ++itr Advance iterator itr to next location *itr Return reference to object stored at iterator itr s location itr1 == itr2 Return true if itr1 and itr2 refer to same location; otherwise return false itr1!= itr2 Return true if itr1 and itr2 refer to different locations; otherwise return false 24

25 Example: printlist template <typename Container> void printlist (const Container & lst) { for (typename Container::const_iterator itr = lst.begin(); itr!= lst.end(); ++itr) { cout << *itr << endl; } } 25

26 Constant Iterators iterator begin () const_ iterator begin () const iterator end () const st_ iterator end () const Appropriate version above returned based on whether container is const If const_iterator used, then *itr cannot appear on left-hand side of assignment (e.g., *itr=0 ) 26

27 Better printlist 27

28 Container Operations Requiring Iterators iterator insert (iterator pos, const Object & x) Add x into list, prior to position given by iterator pos Return iterator representing position of inserted item O(1) for lists, O(N) for vectors iterator erase (iterator pos) Remove object whose position is given by iterator pos Return iterator representing position of item following pos This operation invalidates pos O(1) for lists, O(N) for vectors iterator erase (iterator start, iterator end) Remove all items beginning at position start, up to, but not including end 28

29 Implementation of Vector constructor copy constructor destructor operator= 29

30 Implementation of Vector Automatic resize 30

31 Implementation of Vector Iterators (implemented using simple pointers) Iterator methods 31

32 Implementation of List Iterators implemented using nested class 32

33 Implementation of List 33

34 Implementation of List Empty list 34

35 Implementation of List Allows inheriting classes to access these. Gives List class access to constructor. 35

36 Implementation of List Allows inheriting classes to access these. Note: there is no const here Gives List class access to constructor. 36

37 Implementation of List 37

38 Implementation of List 38

39 Implementation of List 39

40 Stack ADT Stack is a list where insert and remove take place only at the top Operations Push (insert) element e e on top of stack Pop (remove) element from top of stack Top: return element at top of stack LIFO (Last In First Out) 40

41 Stack Implementation Linked List Vector template <typename Object> class stack { public: stack () {} void push (Object & x) {? s.push_front (x); } void pop () { s.pop_front (); } Object & top () { s.front (); } private: list<object> s; }???? template <typename Object> class stack { public: stack () {} void push (Object & x) { s.push_back? (x); } void pop () { s.pop_back (); } Object & top () { s.back (); } private: vector<object> s; } 41

42 Stack Implementation Linked List template <typename Object> class stack { public: stack () {} void push (Object & x) {? s.push_front (x); } void pop () {? s.pop_front (); } Object & top () {? s.front (); } private: list<object> s; } Vector template <typename Object> class stack { public: stack () {} void push (Object & x) { s.push_back (x); } void pop () { s.pop_back (); } Object & top () { s.back (); } private: vector<object> s; } 42

43 Running Times? Stack Implementation Linked List template <typename Object> class stack { public: stack () {} void push (Object & x) { s.push_front (x); } void pop () { s.pop_front (); } Object & top () { s.front (); } private: list<object> s; } Vector template <typename Object> class stack { public: stack () {} void push (Object & x) { s.push_back (x); } void pop () { s.pop_back (); } Object & top () { s.back (); } private: vector<object> s; } 43

44 C++ STL Stack Class Methods Push, pop, top Empty, size #include <stack> stack<int> s; for (int i = 0; i < 5; i++ ) { s.push(i); } while (!s.empty()) { cout << s.top() << endl; s.pop(); } 44

45 Stack Applications Balancing symbols: ((()())(())) stack<char> s; How does this work? while not end of file { read character c if c = ( then s.push(c) if c = ) then if s.empty() then error else s.pop() } if (! s.empty()) then error else okay 45

46 Stack Applications Postfix expressions 1 2 * * + Means ((1 * 2) + 3) + (4 * 5) HP calculators Unambiguous (no need for paranthesis) Infix needs paranthesis or else implicit precedence specification to avoid ambiguity Eg E.g., trya+(b*c)and and (a+b)*c Postfix evaluation uses stack Class PostFixCalculator { public:... void Multiply () { int i1 = s.top(); s.pop(); int i2 = s.top(); s.pop(); } s.push (i1 * i2); } private: stack<int> s; 46

47 Stack Applications Function calls Programming g languages g use stacks to keep track of function calls When a function call occurs Push CPU registers and program counter on to stack ( activation record or stack frame ) Upon return, restore registers and program counter from top stack frame and pop 47

48 Queue ADT Queue is a list where insert takes place at the back, but remove takes place at the front Operations Enqueue (insert) element at the back of the queue Dequeue (remove and return) element from the front of the queue FIFO (First In First Out) Dequeue here Enque here front back 48

49 Queue Implementation Linked List template <typename Object> class queue { public: queue () {} void enqueue (Object & x) { q.push_back (x); } Object & dequeue () { Object & x = q.front (); q.pop_front (); return x; } private: list<object> q; } How would the runtime change if vector is used in implementation? Running time? 49

50 C++ STL Queue Class Methods Push (at back) Pop (from front) Back, front Empty, size #include <queue> queue<int> q; for (int i = 0; i < 5; i++ ) { q.push(i); } while (!q.empty()) { cout << q.front() << endl; q.pop(); } 50

51 Queue Applications Job scheduling Graph traversals Queuing theory 51

52 Summary Abstract Data Types (ADTs) Linked list Stack Queue C++ Standard Template Library (STL) Numerous applications Building blocks for more complex data structures 52

### CHAPTER 4 ESSENTIAL DATA STRUCTRURES

CHAPTER 4 ESSENTIAL DATA STRUCTURES 72 CHAPTER 4 ESSENTIAL DATA STRUCTRURES In every algorithm, there is a need to store data. Ranging from storing a single value in a single variable, to more complex

### Integrating the C++ Standard Template Library Into the Undergraduate Computer Science Curriculum

Integrating the C++ Standard Template Library Into the Undergraduate Computer Science Curriculum James P. Kelsh James.Kelsh@cmich.edu Roger Y. Lee lee@cps.cmich.edu Department of Computer Science Central

### Quiz 4 Solutions EECS 211: FUNDAMENTALS OF COMPUTER PROGRAMMING II. 1 Q u i z 4 S o l u t i o n s

Quiz 4 Solutions Q1: What value does function mystery return when called with a value of 4? int mystery ( int number ) { if ( number

### Cours de C++ Utilisations des conteneurs

Cours de C++ Utilisations des conteneurs Cécile Braunstein cecile.braunstein@lip6.fr 1 / 18 Introduction Containers - Why? Help to solve messy problems Provide useful function and data structure Consistency

### 7.1 Our Current Model

Chapter 7 The Stack In this chapter we examine what is arguably the most important abstract data type in computer science, the stack. We will see that the stack ADT and its implementation are very simple.

### Cpt S 223. School of EECS, WSU

Priority Queues (Heaps) 1 Motivation Queues are a standard mechanism for ordering tasks on a first-come, first-served basis However, some tasks may be more important or timely than others (higher priority)

LINKED DATA STRUCTURES 1 Linked Lists A linked list is a structure in which objects refer to the same kind of object, and where: the objects, called nodes, are linked in a linear sequence. we keep a reference

### Curriculum Map. Discipline: Computer Science Course: C++

Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code

Object-Oriented Desin and Prorammin C++ Container Classes Outline Introduction Container Class Objectives Class Library Architecture Parameterized Types Preprocessor Macros enclass void Pointer Method

### Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Data Structures Page 1 of 24 A.1. Arrays (Vectors) n-element vector start address + ielementsize 0 +1 +2 +3 +4... +n-1 start address continuous memory block static, if size is known at compile time dynamic,

### PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

### Object Oriented Software Design II

Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February

### C++ Support for Abstract Data Types

Topics C++ Support for Abstract Data Types Professor Department of EECS d.schmidt@vanderbilt.edu Vanderbilt University www.cs.wustl.edu/schmidt/ (615) 343-8197 Describing Objects Using ADTs Built-in vs.

### An Incomplete C++ Primer. University of Wyoming MA 5310

An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages

### INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY A PATH FOR HORIZING YOUR INNOVATIVE WORK A REVIEW ON THE USAGE OF OLD AND NEW DATA STRUCTURE ARRAYS, LINKED LIST, STACK,

### Collaboration policy. Where to get help Email (but no code in email) Office hours Lab TAs in Friend 008/009 Bounce ideas (but not code) off classmates

Collaboration policy Programs: Do not use someone else s code unless specifically authorized Exceptions Code from course materials OK [cite source] Coding with partner OK after first assignment [stay tuned]

### vector vec double # in # cl in ude <s ude tdexcept> tdexcept> // std::ou std t_of ::ou _range t_of class class V Vector { ector {

Software Design (C++) 3. Resource management and exception safety (idioms and technicalities) Juha Vihavainen University of Helsinki Preview More on error handling and exceptions checking array indices

### BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security & BSc. (Hons.) Software Engineering Cohort: BIS/05/FT BCNS/05/FT BSE/05/FT Examinations for 2005-2006 / Semester

### El Dorado Union High School District Educational Services

El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.

### Algorithms and Abstract Data Types

Algorithms and Abstract Data Types Informally, algorithm means is a well-defined computational procedure that takes some value, or set of values, as input and produces some other value, or set of values,

### Please note that some of the resources used in this assignment require a Stanford Network Account and therefore may not be accessible.

Please note that some of the resources used in this assignment require a Stanford Network Account and therefore may not be accessible. CS107 Handout 09 Spring 2008 April 9, 2008 Assignment 2: Six Degrees

### D06 PROGRAMMING with JAVA

Cicles Formatius de Grau Superior Desenvolupament d Aplicacions Informàtiques D06 PROGRAMMING with JAVA Ch20 Data Structures I PowerPoint presentation, created by Angel A. Juan - ajuanp(@)gmail.com, for

### 6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang

6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang Today s topics Why objects? Object-oriented programming (OOP) in C++ classes fields & methods objects representation

### Algorithms and Data Structures Written Exam Proposed SOLUTION

Algorithms and Data Structures Written Exam Proposed SOLUTION 2005-01-07 from 09:00 to 13:00 Allowed tools: A standard calculator. Grading criteria: You can get at most 30 points. For an E, 15 points are

### Why you shouldn't use set (and what you should use instead) Matt Austern

Why you shouldn't use set (and what you should use instead) Matt Austern Everything in the standard C++ library is there for a reason, but it isn't always obvious what that reason is. The standard isn't

### Towards Relaxing STM. Christoph M. Kirsch, Michael Lippautz! University of Salzburg. Euro-TM Workshop, April 2014

Towards Relaxing STM Christoph M. Kirsch, Michael Lippautz! University of Salzburg! Euro-TM Workshop, April 2014 Problem linear scalability positive scalability good performance throughput (#transactions/time)

### Object Oriented Software Design II

Object Oriented Software Design II C++ intro Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 26, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February 26,

### Coding conventions and C++-style

Chapter 1 Coding conventions and C++-style This document provides an overview of the general coding conventions that are used throughout oomph-lib. Knowledge of these conventions will greatly facilitate

### API for java.util.iterator. ! hasnext() Are there more items in the list? ! next() Return the next item in the list.

Sequences and Urns 2.7 Lists and Iterators Sequence. Ordered collection of items. Key operations. Insert an item, iterate over the items. Design challenge. Support iteration by client, without revealing

### Monitor Object. An Object Behavioral Pattern for Concurrent Programming. Douglas C. Schmidt

Monitor Object An Object Behavioral Pattern for Concurrent Programming Douglas C. Schmidt schmidt@cs.wustl.edu Department of Computer Science Washington University, St. Louis 1 Intent The Monitor Object

### WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER Course Outline (2015) Basic Programming With Procedural & Object Oriented Concepts (C, C++) Training Office# Road: 11, House: 1 A, Nikunja 2, Khilkhet,

### Software Engineering Techniques

Software Engineering Techniques Low level design issues for programming-in-the-large. Software Quality Design by contract Pre- and post conditions Class invariants Ten do Ten do nots Another type of summary

Introduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized

### Engineering Problem Solving with C++, Etter/Ingber

Engineering Problem Solving with C++, Etter/Ingber Chapter 3 Control Structures 1 Control structures Algorithm Development Conditional Expressions Selection Statements Repetition Statements Structuring

### Design Patterns in C++

Design Patterns in C++ Concurrency Patterns Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa May 4, 2011 G. Lipari (Scuola Superiore Sant Anna) Concurrency Patterns May 4,

### UTSA Department of Electrical and Computer Engineering EE 3223 - C++ Data Structures Syllabus Fall 2015 Part A - Course Outline

UTSA EE 3223 - C++ Data Structures Syllabus Fall 2015 Part A - Course Outline Catalog Description: 3 hours credit. Review of C/C++ non-object oriented programming concepts. Object-oriented programming

### Java Application Developer Certificate Program Competencies

Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle

### Data Abstraction and Hierarchy

Data Abstraction and Hierarchy * This research was supported by the NEC Professorship of Software Science and Engineering. Barbara Liskov Affiliation: MIT Laboratory for Computer Science Cambridge, MA,

### Variable Base Interface

Chapter 6 Variable Base Interface 6.1 Introduction Finite element codes has been changed a lot during the evolution of the Finite Element Method, In its early times, finite element applications were developed

### ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology) Subject Description: This subject deals with discrete structures like set theory, mathematical

### A Comparison of Task Pools for Dynamic Load Balancing of Irregular Algorithms

A Comparison of Task Pools for Dynamic Load Balancing of Irregular Algorithms Matthias Korch Thomas Rauber Universität Bayreuth Fakultät für Mathematik, Physik und Informatik Fachgruppe Informatik {matthias.korch,

### Fondamenti di C++ - Cay Horstmann 1

Fondamenti di C++ - Cay Horstmann 1 Review Exercises R10.1 Line 2: Can't assign int to int* Line 4: Can't assign Employee* to Employee Line 6: Can't apply -> to object Line 7: Can't delete object Line

### QUIZ-II QUIZ-II. Chapter 5: Control Structures II (Repetition) Objectives. Objectives (cont d.) 20/11/2015. EEE 117 Computer Programming Fall-2015 1

QUIZ-II Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. (For

### Concurrent Data Structures

1 Concurrent Data Structures Mark Moir and Nir Shavit Sun Microsystems Laboratories 1.1 Designing Concurrent Data Structures............. 1-1 Performance Blocking Techniques Nonblocking Techniques Complexity

### GENERIC and GIMPLE: A New Tree Representation for Entire Functions

GENERIC and GIMPLE: A New Tree Representation for Entire Functions Jason Merrill Red Hat, Inc. jason@redhat.com 1 Abstract The tree SSA project requires a tree representation of functions for the optimizers

### Crash Course in Java

Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is

### AP Computer Science AB Syllabus 1

AP Computer Science AB Syllabus 1 Course Resources Java Software Solutions for AP Computer Science, J. Lewis, W. Loftus, and C. Cocking, First Edition, 2004, Prentice Hall. Video: Sorting Out Sorting,

### Affdex SDK for Windows!

Affdex SDK for Windows SDK Developer Guide 1 Introduction Affdex SDK is the culmination of years of scientific research into emotion detection, validated across thousands of tests worldwide on PC platforms,

### Grundlagen der Betriebssystemprogrammierung

Grundlagen der Betriebssystemprogrammierung Präsentation A3, A4, A5, A6 21. März 2013 IAIK Grundlagen der Betriebssystemprogrammierung 1 / 73 1 A3 - Function Pointers 2 A4 - C++: The good, the bad and

### Data Structures and Algorithms

Data Structures and Algorithms Algimantas Juozapavièius algimantas.juozapavicius@maf.vu.lt Vilnius University Lithuania The goal of the course: provide a comprehensive introduction to the modern study

### Language-Independent Interactive Data Visualization

Language-Independent Interactive Data Visualization Alistair E. R. Campbell, Geoffrey L. Catto, and Eric E. Hansen Hamilton College 198 College Hill Road Clinton, NY 13323 acampbel@hamilton.edu Abstract

### Dynamic Load Balancing. Using Work-Stealing 35.1 INTRODUCTION CHAPTER. Daniel Cederman and Philippas Tsigas

CHAPTER Dynamic Load Balancing 35 Using Work-Stealing Daniel Cederman and Philippas Tsigas In this chapter, we present a methodology for efficient load balancing of computational problems that can be easily

### Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

### Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm PURPOSE Getting familiar with the Linux kernel source code. Understanding process scheduling and how different parameters

### A brief introduction to C++ and Interfacing with Excel

A brief introduction to C++ and Interfacing with Excel ANDREW L. HAZEL School of Mathematics, The University of Manchester Oxford Road, Manchester, M13 9PL, UK CONTENTS 1 Contents 1 Introduction 3 1.1

### DocStore: Document Database for MySQL at Facebook. Peng Tian, Tian Xia 04/14/2015

DocStore: Document Database for MySQL at Facebook Peng Tian, Tian Xia 04/14/2015 Agenda Overview of DocStore Document: A new column type to store JSON New Built-in JSON functions Document Path: A intuitive

### Conditions for Strong Synchronization In Concurrent Data Types

Conditions for Strong Synchronization In Concurrent Data Types Maged Michael IBM TJ Watson Research Center Joint work with Martin Vechev and Vijay Sarsawat Joint work with Hagit Attiya, Rachid Guerraoui,

### 6 March 2007 1. Array Implementation of Binary Trees

Heaps CSE 0 Winter 00 March 00 1 Array Implementation of Binary Trees Each node v is stored at index i defined as follows: If v is the root, i = 1 The left child of v is in position i The right child of

### Object Oriented Software Design

Object Oriented Software Design Inner classes, RTTI, Tree implementation Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 29, 2010 G. Lipari (Scuola Superiore Sant

### AP Computer Science A 2012 Scoring Guidelines

AP Computer Science A 2012 Scoring Guidelines The College Board The College Board is a mission-driven not-for-profit organization that connects students to college success and opportunity. Founded in 1900,

### Tutorial 9: Skeletal Animation

Tutorial 9: Skeletal Animation Summary In the last couple of tutorials, you ve seen how to create a scene graph, and implemented a simple animating cube robot using them. You re probably wondering how

### 1 Posix API vs Windows API

1 Posix API vs Windows API 1.1 File I/O Using the Posix API, to open a file, you use open(filename, flags, more optional flags). If the O CREAT flag is passed, the file will be created if it doesnt exist.

### Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

Open Crystal Reports From the Windows Start menu choose Programs and then Crystal Reports. Creating a Blank Report Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick

### Project 4 DB A Simple database program

Project 4 DB A Simple database program Due Date April (Friday) Before Starting the Project Read this entire project description before starting Learning Objectives After completing this project you should

### Software Vulnerabilities

Software Vulnerabilities -- stack overflow Code based security Code based security discusses typical vulnerabilities made by programmers that can be exploited by miscreants Implementing safe software in

### The Separation of Interface and Implementation in C++

From Proceedings of the Third USENIX C++ conference The Separation of Interface and Implementation in C++ Bruce Martin Hewlett-Packard Laboratories 1501 Page Mill Road Palo Alto, California 94304 martin@hplabs.hp.com

### An Introduction to Programming and Computer Science

An Introduction to Programming and Computer Science Maria Litvin Phillips Academy, Andover, Massachusetts Gary Litvin Skylight Software, Inc. Skylight Publishing Andover, Massachusetts Copyright 1998 by

### Engineering Problem Solving with C++, Etter

Engineering Problem Solving with C++, Etter Chapter 7 Strings 12-11-13 1 Strings Character Strings The string Class. 2 C style strings functions defined in cstring CHARACTER STRINGS 3 C Style Character

### Wait-Free Queues With Multiple Enqueuers and Dequeuers

Wait-Free Queues With Multiple Enqueuers and Dequeuers Alex Kogan Department of Computer Science Technion, Israel sakogan@cs.technion.ac.il Erez Petrank Department of Computer Science Technion, Israel

### Why Use Binary Trees?

Binary Search Trees Why Use Binary Trees? Searches are an important application. What other searches have we considered? brute force search (with array or linked list) O(N) binarysearch with a pre-sorted

### MSP430 C/C++ CODE GENERATION TOOLS Compiler Version 3.2.X Parser Error/Warning/Remark List

MSP430 C/C++ CODE GENERATION TOOLS Compiler Version 3.2.X Parser Error/Warning/Remark List This is a list of the error/warning messages generated by the Texas Instruments C/C++ parser (which we license

### Monitors, Java, Threads and Processes

Monitors, Java, Threads and Processes 185 An object-oriented view of shared memory A semaphore can be seen as a shared object accessible through two methods: wait and signal. The idea behind the concept

### C Dynamic Data Structures. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

C Dynamic Data Structures University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell Data Structures A data structure is a particular organization of data in memory. We want to

### Object Oriented Software Design

Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

### Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer

### C++ Language Tutorial

cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain

### Lecture 12: Abstract data types

Lecture 12: Abstract data types Algebras Abstract data types Encapsulation and information hiding Parameterization Algebras Definition Which kinds of data do we want to discuss? What can we do with it?

### cs2010: algorithms and data structures

cs2010: algorithms and data structures Lecture 11: Symbol Table ADT. Vasileios Koutavas 28 Oct 2015 School of Computer Science and Statistics Trinity College Dublin Algorithms ROBERT SEDGEWICK KEVIN WAYNE

### Computing Concepts with Java Essentials

2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann

### CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly

### Automated Virtual Cloud Management: The need of future

Automated Virtual Cloud Management: The need of future Prof. (Ms) Manisha Shinde-Pawar Faculty of Management (Information Technology), Bharati Vidyapeeth Univerisity, Pune, IMRDA, SANGLI Abstract: With

### http://algs4.cs.princeton.edu dictionary find definition word definition book index find relevant pages term list of page numbers

ROBERT SEDGEWICK KEVI WAYE F O U R T H E D I T I O ROBERT SEDGEWICK KEVI WAYE ROBERT SEDGEWICK KEVI WAYE Symbol tables Symbol table applications Key-value pair abstraction. Insert a value with specified.

### 2/9/2010. Standard Approach to Distribution. Remote Procedure Calls (RPC) Example: Music Jukebox in the Cloud

Remote Batch Invocation for Compositional Object Services CPS 296.1 9 th Feb 2010 Vamsidhar Thummala Content borrowed from William R Cook Standard Approach to Distribution Step I: Design a language Clean

### Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING. The Design-Code-Debug Cycle. Divide and Conquer! Documentation is Code

Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING Lecture 16 CS2110 Spring 2013 2 Don't sit down at the terminal immediately and start hacking Design stage THINK first about the data you

### Applied Informatics C++ Coding Style Guide

C++ Coding Style Guide Rules and Recommendations Version 1.4 Purpose of This Document This document describes the C++ coding style employed by Applied Informatics. The document is targeted at developers

PHP MySQL COURSE WITH OOP COURSE COVERS: PHP MySQL OBJECT ORIENTED PROGRAMMING WITH PHP SYLLABUS PHP 1. Writing PHP scripts- Writing PHP scripts, learn about PHP code structure, how to write and execute

### Course materials. In addition to these slides, C++ API header files, a set of exercises, and solutions, the following are useful:

Course materials In addition to these slides, C++ API header files, a set of exercises, and solutions, the following are useful: OpenCL C 1.2 Reference Card OpenCL C++ 1.2 Reference Card These cards will

### Resurrecting Ada s Rendez-Vous in Java

Resurrecting Ada s Rendez-Vous in Java Luis Mateu, José M. Piquer and Juan León DCC - Universidad de Chile Casilla 2777, Santiago, Chile lmateu@dcc.uchile.cl Abstract Java is a programming language designed

### Splicing Maps and Sets

Document number: N3586 Date: 2013-03-17 Project: Programming Language C++ Reference: N3485 Reply to: Alan Talbot cpp@alantalbot.com Howard Hinnant howard.hinnant@gmail.com Related Documents Splicing Maps

### Introduction to LabVIEW Design Patterns

Introduction to LabVIEW Design Patterns What is a Design Pattern? Definition: A well-established solution to a common problem. Why Should I Use One? Save time and improve the longevity and readability

### Java EE Web Development Course Program

Java EE Web Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive types, variables, basic operators, expressions,

### Optimizing Load Balance Using Parallel Migratable Objects

Optimizing Load Balance Using Parallel Migratable Objects Laxmikant V. Kalé, Eric Bohm Parallel Programming Laboratory University of Illinois Urbana-Champaign 2012/9/25 Laxmikant V. Kalé, Eric Bohm (UIUC)

### Creating Database Tables in Microsoft SQL Server

Creating Database Tables in Microsoft SQL Server Microsoft SQL Server is a relational database server that stores and retrieves data for multi-user network-based applications. SQL Server databases are

### Dice. David Watkins Emily Chen Khaled Atef Phillip Schiffrin. djw2146 ec2805 kaa2168 pjs2186. Manager System Architect Testing Language Guru

Dice David Watkins Emily Chen Khaled Atef Phillip Schiffrin djw2146 ec2805 kaa2168 pjs2186 Manager System Architect Testing Language Guru September 30 th, 2015 1 DESCRIPTION Dice is a distributed systems

### File System Management

Lecture 7: Storage Management File System Management Contents Non volatile memory Tape, HDD, SSD Files & File System Interface Directories & their Organization File System Implementation Disk Space Allocation

### Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm

### Binary Search Trees. Ric Glassey glassey@kth.se

Binary Search Trees Ric Glassey glassey@kth.se Outline Binary Search Trees Aim: Demonstrate how a BST can maintain order and fast performance relative to its height Properties Operations Min/Max Search

### RTEMS Porting Guide. On-Line Applications Research Corporation. Edition 4.10.99.0, for RTEMS 4.10.99.0. 17 July 2015

RTEMS Porting Guide Edition 4.10.99.0, for RTEMS 4.10.99.0 17 July 2015 On-Line Applications Research Corporation On-Line Applications Research Corporation TEXinfo 2013-02-01.11 COPYRIGHT c 1988-2015.