Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.

Similar presentations


Presentation on theme: "Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010."— Presentation transcript:

1 Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010

2 Outline Software Development Abstract Data Type (ADT)

3 Software Development Hardware: actual physical components (such as CPU, memory, hard drive…) Software: refers to programs used to control the operation of the hardware. Is a complex process that is both art and science Requires a good deal of imagination, creativity and ingenuity

4 Hardware Progress Trend

5 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

6 Software Development Model One of the earliest strategies for development software is known as the Waterfall Model

7 Waterfall Model

8 Realistic Waterfall Model

9 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

10 Problem Analysis and Specification Problem Analysis and Specification: The problem is analyzed and a specification for the problem is formulated For example: if we obtain a job request looks like:

11 Task Example Because of new government regulations, we must keep more accurate record of all students currently receiving financial aid and submit regular report to FFAO (Federal Financial Aid Office). Could we get the computer to do this for us???

12 Task Analysis Purpose Pre-condition (input): describe the state of processing before the program is executed Post-condition (output): describe the state of processing after the program is executed

13 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

14 Design Design: A plan for solving the problem is formulated Various design methods have been developed, two of major designs we describe here: top-down design and object-oriented design

15 Top-down design The original problem is partitioned into simpler sub-problems For example, the problem we just had can be obviously divided into: 1. Get the student records 2. Process the records 3. Prepare the reports

16 One level partition

17 Two level partition

18 Three level partition

19 OOD: Object-Oriented Design Identify the objects in the problem's specification and their types. Identify the operations or tasks to manipulate the objects

20 Program=Algorithm + Data Structure Algorithm: “a step by step procedure for solving a problem or accomplishing some end” In computer science, algorithm must be: 1. Definite, unambiguous 2. Simple 3. Finite

21 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

22 Coding There’s not much we can talk in coding, you all know what it is. After you select the language, three major principles you need to follow: 1. Programs and Subprograms should be well structured 2. All source code should be documented 3. It should be formatted in a style that enhances its readability

23 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

24 Testing, Execution, and Debugging Errors happen all the time!!! There are three different points at which errors can be introduced: 1. Syntax errors 2. Run-time errors 3. Logic errors

25 The "V" Life Cycle Model

26 Two major types of testing Black box testing: Outputs produced for various inputs Checked for correctness Do not consider structure of program component itself. (so basically, it just test a lot of different inputs and match with the expected outputs )

27 Two major types of testing White box testing: examine code’s internal structure (Test for every loop, if statement, functions…) Test data is carefully selected

28 Software Development Phases Problem Analysis and Specification Design Coding Testing, Execution, and Debugging Maintenance

29 After the software has been used for several years, they will require modifications Studies show that a higher percentage of computing budgets and programmer time are devoted to software maintenance 1970s35-40% 1980s40-60% 1990s70-80% 2000s80-90%

30 Program Algorithms + Data Structure = Programs Algorithms: Must be definite and unambiguous Simple enough to carry out by computer Need to be terminated after a finite number of operations

31 Outline Software Development Abstract Data Type (ADT)

32 A first look an ADTs Solving a problem involves processing data, and an important part of the solution is the careful organization of the data In order to do that, we need to identify: 1. The collection of data items 2. Basic operation that must be performed on them Abstract Data Type (ADT): a collection of data items together with the operations on the data

33 Abstract Data Type (ADT) The word “abstract” refers to the fact that the data and the basic operations defined on it are being studied independently of how they are implemented We think about what can be done with the data, not how it is done

34 Implementation of ADT An implementation of ADT consists of storage structures to store the data items and algorithms for basic operation

35 Data Structures, Abstract Data Types, and Implementations Consider example of an airplane flight with 10 seats to be assigned Tasks List available seats Reserve a seat How to store, access data?

36 Data Structures, Abstract Data Types, and Implementations Consider example of an airplane flight with 10 seats to be assigned Tasks List available seats Reserve a seat How to store, access data? 10 individual variables

37 Use 10 individual variables Algorithm to List available seats 1. If seat1 == ‘ ’: display 1 2. If seat2 == ‘ ’: display 2. 10. If seat10 == ‘ ’: display 10 Algorithm to Reserve a seat 1. Set DONE to false 2. If seat1 ==‘ ’: print “do you want seat #1??” Get answer if answer==‘Y’: set seat1 to ‘X’ set Done to True 3. If seat2 ==‘ ’: print “do you want seat #2??” Get answer if answer==‘Y’: set seat2 to ‘X’ set Done to True.

38 Data Structures, Abstract Data Types, and Implementations Consider example of an airplane flight with 10 seats to be assigned Tasks List available seats Reserve a seat How to store, access data? 10 individual variables An array of variables

39 Use Array Algorithm to List available seats For number ranging from 0 to max_seats-1, do: If seat[number] == ‘ ’: Display number Algorithm to Reserve a seat Readin number of seat to be reserved If seat[number] is equal to ‘ ’: set seat[number] to ‘X’ Else Display a message that the seat having this number is occupied

40 ADTs In this simple example, it does illustrate the concept of an Abstract Data Type ADT consists of 1. The collection of data items 2. Basic operation that must be performed on them In the example, a collection of data is a list of seats The basic operations are (1) Scan the list to determine which seats are occupied (2) change seat’s status

41 Data Structure and Abstract Data Type The term of Data Structure and Abstract Data Type are often used interchangeably However, we use ADT when data is studied at a logical level The term data structure refers to a construct in programming language that can be used to store data


Download ppt "Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010."

Similar presentations


Ads by Google