Propedéutico de Programación



Similar documents
Propedéutico de Programación

P R O C E S S O L I C I T A T Ó R I O n º / E D I T A L D E P R E G Ã O P R E S E N C I A L n º. 0010/

Announcements. HW due today, 2 to grade this week Welcome back from Spring Break!

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

Software Development: An Introduction

Data Structures Using C++ 2E. Chapter 5 Linked Lists

Topic # 08. Structuring System Process Requirements. CIS Life Cycle and Requirements Structuring Stage

Warm-Up. Today s Objective/Standards: Students will use the correct order of operations to evaluate algebraic expressions/ Gr. 6 AF 1.

Data Flow Diagrams. Outline. Some Rules for External Entities 1/25/2010. Mechanics

Binary Heap Algorithms

ATM Case Study Part 1

DATA STRUCTURE - STACK

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

RELATIONAL DATABASE DESIGN

Object-Oriented Design

Once the schema has been designed, it can be implemented in the RDBMS.

The first program: Little Crab

Design and UML Class Diagrams

CompSci-61B, Data Structures Final Exam

2 The first program: Little Crab

recursion, O(n), linked lists 6/14

Some programming experience in a high-level structured programming language is recommended.

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

User Manual. for the. Database Normalizer. application. Elmar Jürgens

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Abstract Data Type. EECS 281: Data Structures and Algorithms. The Foundation: Data Structures and Abstract Data Types

Unordered Linked Lists

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

Object-oriented design methodologies

Ordered Lists and Binary Trees

Principles of Software Construction: Objects, Design, and Concurrency. Domain Modeling and Specifying System Behavior. toad

Unit Title: Personnel Information Systems Unit Reference Number: F/601/7510 Guided Learning Hours: 160 Level: Level 5 Number of Credits: 18

p-values and significance levels (false positive or false alarm rates)

APP INVENTOR. Test Review

The ADT Binary Search Tree

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Chapter 7: Relational Database Design

Chapter 2: Entity-Relationship Model. E-R R Diagrams

Object-Oriented Design Guidelines

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

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

Node-Based Structures Linked Lists: Implementation

Microsoft Access 3: Understanding and Creating Queries

Analysis of a Search Algorithm

El Dorado Union High School District Educational Services

Beginning Microsoft Access

A basic create statement for a simple student table would look like the following.

Database Design Methodology

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Introduction to Object-Oriented Programming

Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3)

Why are Business Process Models often too complex? Do s and Don ts for Business Process Modelers

CSE 308. Coding Conventions. Reference

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

Conceptual Design: Entity Relationship Models. Objectives. Overview

TECH. Requirements. Why are requirements important? The Requirements Process REQUIREMENTS ELICITATION AND ANALYSIS. Requirements vs.

Recognizing PL/SQL Lexical Units. Copyright 2007, Oracle. All rights reserved.

Data Structures and Algorithms

Using Edit-Distance Functions to Identify Similar Addresses Howard Schreier, U.S. Dept. of Commerce, Washington DC

Key Skills IT Level 3. Lagan Health Club. Classroom Activity

Chapter 1 Learning to Program With Alice

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

1. Process Modeling. Process Modeling (Cont.) Content. Chapter 7 Structuring System Process Requirements

Chapter 3. Data Analysis and Diagramming

Introduction to Microsoft Access

Module 1. Introduction to Software Engineering. Version 2 CSE IIT, Kharagpur

90 HOURS PROGRAMME LEVEL A1

Instructional Design Framework CSE: Unit 1 Lesson 1

Describe the process of parallelization as it relates to problem solving.

Java: Learning to Program with Robots. Chapter 11: Building Quality Software

Exercise 8: SRS - Student Registration System

6 March Array Implementation of Binary Trees

Word 2007: Mail Merge Learning Guide

Innovative Fraud Monitoring. Identifying and combatting fraud in real time January 2014

Exporting Addresses. for Use in Outlook Express

Data Structures Using C++ 2E. Chapter 5 Linked Lists

How To Filter A List In Jangomail In A Database In A Row (For A List)

GCE Computing. COMP3 Problem Solving, Programming, Operating Systems, Databases and Networking Report on the Examination.

Digital Literacy: Communicating, Collaborating and E- Safety, Multimedia, Music and Sound, Digital Imagery

Binary search algorithm

Aras Corporation Aras Corporation. All rights reserved. Notice of Rights. Notice of Liability

The Elective Part of the NSS ICT Curriculum D. Software Development

Linked List as an ADT (cont d.)

PEMBINA TRAILS SCHOOL DIVISION. Information Technology Department. Mayet Online Reports

Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers

User Replicator USER S GUIDE

Common Questions and Concerns About Documentum at NEF

ESCUELA DE LENGUAS CENTRO DE IDIOMAS ESCUELA SUPERIOR POLITECNICA DE CHIMBORAZO LANGUAGE CENTER

CPS122 - OBJECT-ORIENTED SOFTWARE DEVELOPMENT. Team Project

Comprehensive Course Syllabus

TEST-TAKING STRATEGIES FOR READING

Developing Web Applications for Microsoft SQL Server Databases - What you need to know

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

Migrating application users and passwords with Password Manager

Fundamentals of Computer Programming CS 101 (3 Units)

AP Computer Science AB Syllabus 1

6. Standard Algorithms

More on Objects and Classes

How to Define Local Audit Periods and Add Local Audits

Transcription:

Propedéutico de Programación Coordinación de Ciencias Computacionales 9/13 Material preparado por: Dra. Pilar Gómez Gil

Chapter 4 ADT Sorted List

ADT Sorted List Remember the difference between an unsorted list and a sorted list? Remember the definition of a key? If the list is a sorted list of names, what would be the key? of bank balances, what would be the key? of grades, what would be the key?

ADT Unsorted List Operations Transformers MakeEmpty InsertItem DeleteItem Observers IsFull GetLength RetrieveItem Iterators ResetList GetNextItem change state observe state process all

ADT Sorted List Which member function specifications and implementations must change to ensure that any instance of the Sorted List ADT remains sorted at all times? InsertItem DeleteItem

La inserción tendrá que ser de tal manera que la lista siempre se mantenga ordenada

Linked Implementation What about passing spot where item would be if there?

Linked Implementation Is Inserting as easy? Let's see Set location to listdata Set moretosearch to (location!= NULL) while moretosearch switch (item.comparedto(location->info)) case GREATER : Set location to location->next Set moretosearch to (location!= NULL) case LESS : Set moretosearch to false See the problem?

Linked Implementation We need a trailing pointer

Inserting S into a Sorted List predloc location Private data: length 3 listdata C L X currentpos? moretosearch

Finding proper position for S predloc NULL location Private data: length 3 listdata C L X currentpos? moretosearch true

Finding proper position for S predloc location Private data: length 3 listdata C L X currentpos? moretosearch true

Finding Proper Position for S predloc location Private data: length 3 listdata C L X currentpos? moretosearch false

Inserting S into Proper Position predloc location Private data: length 4 listdata C L X currentpos moretosearch false S

Ver sorted.h Ver sorted.cpp

Linked Implementation Does DeleteItem have to be changed?

Object-Oriented Design Methodology Object-oriented design decomposes a problem into classes Four stages to the decomposition process Brainstorming Filtering Scenarios Responsibility algorithms

Object-Oriented Design Methodology Brainstorming A group problem-solving technique that involves the spontaneous contribution of ideas from all members of the group All ideas are potential good ideas Think fast and furiously first, and ponder later A little humor can be a powerful force Brainstorming is designed to produce a list of candidate classes

Object-Oriented Design Methodology Filtering Determine which are the core classes in the problem solution There may be two classes in the list that have many common attributes and behaviors There may be classes that really don t belong in the problem solution

Object-Oriented Design Methodology Scenarios Sequences of steps that describe an interaction between a client and an application or program Simulate class interactions Ask What if? questions Assign responsibilities to each class There are two types of responsibilities What a class must know about itself (knowledge) What a class must be able to do (behavior) Use case A collection of scenarios related to a common goal

Object-Oriented Design Methodology Role playing

Object-Oriented Design Methodology Responsibility Algorithms The algorithms must be written for the responsibilities Knowledge responsibilities usually just return the contents of one of an object s variables Action responsibilities are a little more complicated, often involving calculations Responsibilities algorithms are often decomposed using top-down design

Relationships Between Classes Containment part-of An address class may be part of the definition of a student class Inheritance Classes can inherit data and behavior from other classes is-a

Computer Example Let s work through this problem-solving process by creating an address list Brainstorming and filtering Circling the nouns and underlining the verbs is a good way to begin

Computer Example First pass at a list of classes list name telephone number email address list order names list scraps paper cards Filtered List list, name, telephone number, email address

CRC Cards Can you think of any other useful responsibilities?

CRC Cards Can you think of any other useful responsibilities?

CRC Cards How is this class different from Name and Person?

Responsibility Algorithms Person Class Initialize name.initialize() Write "Enter phone number; press return." Get telephone number Write "Enter email address; press return." Get email address Print Tells name to initialize itself Tells name to print itself name.print() Write "Telephone number: " + telephonenumber Write "Email address: " + emailaddress

Responsibility Algorithms Name Class Initialize "Enter the first name; press return." Read firstname "Enter the last name; press return." Read lastname Print Print "First name: " + firstname Print "Last name: " + lastname