Data Structures and Algorithms. Chapter 1

Similar documents
Purpose of Data Structures

Introduction to Computers & Programming

Object-Oriented Programming. Chapter 4

Artificial Intelligence

Constructors and Destructors. Chapter 6

Data Structure. Lecture#2: Data Structures and Algorithms. U Kang Seoul National University. U Kang (2016) 1

CS133 C Programming. Instructor: Jialiang Lu Office: Information Center 703

Chapter 6 INTRODUCTION TO DATA STRUCTURES AND ALGORITHMS

Abstract Data Types. Different Views of Data:

CSI33 Data Structures

Searching Algorithms. Chapter 11

DATA STRUCTURES CHAPTER 1

What is an algorithm?

Stacks and Queues. Chapter 8 (Cont.)

«Computer Science» Requirements for applicants by Innopolis University

COP 1170 Introduction to Computer Programming using Visual Basic

DSC 201: Data Analysis & Visualization

Lecture 7: Data Abstractions

Artificial Intelligence

TABLES AND HASHING. Chapter 13

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

1.1 Basic Concepts 1

Programming for the Web with PHP

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Advanced Computer Programming

Python The way of a program. Srinidhi H Asst Professor Dept of CSE, MSRIT

FUNCTIONAL PROGRAMMING 1 HASKELL BASICS

COURSE DESCRIPTION. CS 232 Course Title Computer Organization. Course Coordinators

Introduction to Programming Using Java (98-388)

UML Primer. -Elango Sundaram

CS 351 Design of Large Programs Programming Abstractions

COP 1220 Introduction to Programming in C++ Course Justification

Computational Expression

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

QUEEN MARY, UNIVERSITY OF LONDON

C++ Quick Guide. Advertisements

81067AE Development Environment Introduction in Microsoft

Standards/ Strands Essential Questions Skills Assessment. What are the strengths and weaknesses of Processing as a programming language?

Tentative Teaching Plan Department of Software Engineering Name of Teacher Dr. Naeem Ahmed Mahoto Course Name Computer Programming

Computational Optimization ISE 407. Lecture1. Dr. Ted Ralphs

Python review. 1 Python basics. References. CS 234 Naomi Nishimura

Introduction to C++ Lecture Set 2. Introduction to C++ Week 2 Dr Alex Martin 2013 Slide 1

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011

Object-Oriented Programming Concepts

Exercise: Using Numbers

VARIABLES AND TYPES CITS1001

Overview. Arrays and their properties Creating arrays Accessing array elements Modifying array elements Loops and arrays. Initialization Searching

Madhya Pradesh Bhoj (Open) University, Bhopal

Basic data types. Building blocks of computation

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Algorithms and Data Structures

Grade Weights. Language Design and Overview of COOL. CS143 Lecture 2. Programming Language Economics 101. Lecture Outline

An Activation Record for Simple Subprograms. Activation Record for a Language with Stack-Dynamic Local Variables

Dept. of Computer and Information Science (IDA) Linköpings universitet Sweden

LECTURE 17. Expressions and Assignment

ENGR 102 Engineering Lab I - Computation

Java Software Solutions for AP Computer Science 3rd Edition, Lewis et al. 2011

Object-Oriented Software Construction

Computer Science (330)

9 Working with the Java Class Library

What is an algorithm?

PROGRAMMING FUNDAMENTALS

Chapter 1: Introduction to Computers and Programming

CHAPTER 7 OBJECTS AND CLASSES

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. Object Oriented Programming

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

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

Data Structure. Measuring Input size. Composite Data Structures. Linear data structures. Data Structure is: Abstract Data Type 1/9/2014

Object Oriented Programming

Data Structures and Algorithms in Java. Second Year Software Engineering

Tutorial notes on. Object relational structural patterns

Lecture 2 Tao Wang 1

Standard 11. Lesson 9. Introduction to C++( Up to Operators) 2. List any two benefits of learning C++?(Any two points)

Database Management Systems MIT Introduction By S. Sabraz Nawaz

Binghamton University. CS-140 Fall Data Types in Java

Outline. Outline. 1 Chapter 2: Data Abstraction

Dot and Scope Resolution Operator

Introduction... ix. Chapter 1: Exploring Fundamental Programming Concepts... 1

Controls Structure for Repetition

Object-Oriented Design Lecture 5 CSU 370 Fall 2008 (Pucella) Friday, Sep 26, 2008

Measuring Input size. Last lecture recap.

Slides adopted from T. Ferguson Spring 2016

Topics in Software Testing

C# MOCK TEST C# MOCK TEST II

BEng (Hons) Electronic Engineering. BEng (Hons) Telecommunications. Examinations for / Semester 2

University of Technology. Laser & Optoelectronics Engineering Department. C++ Lab.

Introduction to LabVIEW. Modified Powerpoint file taken from ma/courses/es110/

Chapter 2 Working with Data Types and Operators

CS300 Data Structrures (Fall 2014) Abstract data types (ADT s)

Topic 1: Introduction

Outline. policies. with some potential answers... MCS 260 Lecture 19 Introduction to Computer Science Jan Verschelde, 24 February 2016

presented by: Tim Haithcoat University of Missouri Columbia

SECTION II: LANGUAGE BASICS

CSC 1052 Algorithms & Data Structures II: Recursion

INTRODUCTION TO DATA AND PROCEDURE

Introduction. Arizona State University 1

The Imperative Paradigm

13 File Structures. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Java is an objet-oriented programming language providing features that support

Transcription:

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 Chapter 1

1.1 A Philosophy of Data Structures 1.1.1 The need for Data Structures Representing information is fundamental to computer science. The majority of computer programs stores and retrieves information. To be practical in terms of storage space and running time, these programs should organize their information in a way that supports efficient processing. Therefore, the study of data structures and the algorithms that manipulate them is at the heart of computer science.

What is meant by a data structure? A data structure is a data representation and its associated operations. Examples: integer numbers, floating point numbers, arrays of these numbers.

1.1.2 Costs and Benefits Each data structure has associated costs and benefits. A data structure requires a certain amount of space for each data item it stores, time to perform a single basic operation, programming effort. Each problem has constraints on available space and time. The best data structure for a problem is the one that allows the computer program to solve the problem efficiently in terms of the required storage and time.

1.2 Abstract Data Types and Data Structures Definitions: A Type is a collection of values. For example, the Boolean type consists of the values True and False. A Data type is a type together with a collection of operations to manipulate the type. For example, an integer variable is a member of the integer data type.

A Data item is a piece of information or a record whose value is drawn from a type. An Aggregate data item is a complex data item that contains many data items, probably their values are drawn from different data types.

An Abstract data type (ADT) defines a data type in terms of a type and a set of operations on that type. Each operation is defined by its inputs and outputs. An ADT definition does not specify how the data type is implemented. Encapsulation is the process of hiding implementation details.

A Data structure is the physical implementation of an ADT. Each operation associated with the ADT is implemented by one or more subroutines. The term data structure often refers to data stored in a computer's main memory. Example: the mathematical concept of integer, along with operations that manipulate integers, form an ADT. The C++ int variable type is a physical representation of the abstract integer.

A File structure refers to the organization of data on peripheral storage, such as a disk drive or magnetic tape. Data items have both a logical and a physical form. The definition of the data item by an ADT is its logical form, the implementation of the data item within a data structure is its physical form

Data Type ADT Type Operations Data item Logical form Data structure Storage Subroutines Data item Physical form The relationship between data item, ADT and data structure. The ADT defines the logical form of the data type, while the data structure implements the physical form of the data type.

1.3 Problems, Algorithms and Programs Definitions A Problem is a task to be performed. It is best thought of as inputs and corresponding outputs. A problem definition should include constraints on the resources that may be used by an acceptable solution but it should not include any constraints on how the problem should be solved.

A Function is a matching between inputs (the domain) and outputs (the range). Values of the inputs are called the parameters of the function. Therefore, all problems are functions according to this definition.

An Algorithm is a method or a process adopted in order to solve a problem. The algorithm takes the inputs of a certain problem and transforms them to the corresponding outputs of this problem. It is possible to find several different algorithms that can solve a certain problem. Example: a certain sorting algorithm may be preferred for small sets of numbers while another algorithm may be preferred for large sets of numbers.

A Program is an instance of an algorithm in a certain programming language.

1.4 Algorithm Efficiency The efficiency of an algorithm is defined as how efficient this algorithm makes use of the available computer resources. It can be measured by a method called algorithm analysis.