Sie sind auf Seite 1von 5

DATA STRUCTURES AND ALGORITHMS

Data Structures Are original collection of data objects. Refers to the logical organization of data and the operations that may be performed on them. Classification of Data Structures LINEAR a data structure in which the individual components are on ordered sequence. Ex. String, Array, Stack, Queue, record, etc. NON-LINEAR a data structure that has unordered sequence. Ex. Trees, Graphs, etc. STATIC a data structure that has no capacity for change especially with regard to its size attribute during the course of execution. Ex. Array, record, etc. DYNAMIC STRUCTURE is able to change over the time as program execution proceeds. Software Development Methodologies 1. Problem Analysis and Specification 2. Design 3. Coding 4. Testing, Execution and Debugging 5. Maintenance Algorithm A step-by-step procedure for solving a problem or accomplishing some end. The term Algorithm is used in Computer Science to describe a problem solving method suitable for implementation as computer programs.

In Computer Science, the term Algorithm refers to the procedure that can be executed by a computer, and this requirement imposes additional limitations on the instructions that make up these procedures: They must be definite and unambiguous so that it is clear that each instruction is meant to accomplish. They must be simple enough so they can be carried out by the computer. They must cause the algorithm to terminate after a finite number of operations. Pseudocode A pseudoprogramming language that is a mixture of natural language, and symbols, terms and other features commonly used in one or more high-level language. Pseudocode typically includes: The usual computer symbol +, -, *, and / for basic arithmetic operation. Symbolic names (identifiers) to represent the quantities being processed by the algorithm. Some provision for indicating comment. Keywords that are common in high-level language. Indention to set off blocks of instruction. Example Algorithm 1 1. Accept an integer for n. 2. Initialize sum to 0. 3. For each integer I in the range of 1 to n; 3.1 Assign sum + I to sum. 4. Return the value of sum. Algorithm 2 1. Accept an integer for n. 2. Return the value of (n*(n+1))/2

Big O Notation The measurement of performance of an algorithm. Algorithm 1 = O(n) Algorithm 2 = O(1) Basic Control Structures SEQUENCE Steps are performed in a strictly sequential manner. SELECTION one of several alternative actions is selected and executed. REPETITION one or more steps are performed repeatedly. Structured Algorithm Using the basic control structure. Readable and understandable. Can be analyzed and verified easily than unstructured.

Phases of Software Development 1.1 PROBLEM ANALYSIS & SPECIFICATION PURPOSE: Objective of the algorithm/program unit. PRECONDITION: Described the state of processing before a program unit. POSTCONDITION: Describe the state of processing after the program is executed. 1.2. DESIGN TOP-DOWN DESIGN OBJECT-ORIENTED DESIGN CLASS a collection of objects of the same data types. INSTANCE a particular object of the class.

Object-Oriented Design Every object has two (2) parts: 1. 2. DATA MEMBERS store the data. FUNCTION MEMBER operates on the data.

Characteristics of Object-Oriented Programming ENCAPSULATION process of hiding the data and the operation on the data. INHERITANCE A class (derived class or subclass) can use all the attributes and operations of another class (base class or parent class)

Data Types The most important attribute of each data item in a problem is its type, which determines what value it may have, what operations can be performed. SIMPLE DATA TYPES Ex. Int, bool, float, double, char STRUCTURED DATA TYPES Ex. Array

Algorithm + Data Structure = Program


1.3. CODING 1.4. TESTING, EXECUTION, AND DEBUGGING VERIFICATION checking of program consistency. VALIDATION if the output match the specification Verification: Are we building the project right? Validation: Are we building the right project?

Testing, Execution, and Debugging SYNTAX ERRORS violation of the grammar rules of the high-level language in which the program is written. -source code violates the syntax. RUNTIME ERRORS are errors that occurs during program execution. -not detected until the execution of the program has begun. LOGIC ERRORS inaccurate coding of the design or the design itself. DEBUGGING is the process of finding the errors. 1.5. MAINTENANCE Modification New Features

Das könnte Ihnen auch gefallen