[go: up one dir, main page]

0% found this document useful (0 votes)
4 views13 pages

Data Structures & Algorithms: Chapter 1: Overview

This chapter provides an overview of data structures and algorithms, defining data structures as arrangements of data in memory and algorithms as methods to manipulate this data. It discusses the application of these concepts in real-world data storage, programmer's tools, and modeling, as well as introducing object-oriented programming and software engineering principles. Key topics include the definitions of databases, records, fields, and the importance of object-oriented programming features such as inheritance and polymorphism.

Uploaded by

sabersediqi1380
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views13 pages

Data Structures & Algorithms: Chapter 1: Overview

This chapter provides an overview of data structures and algorithms, defining data structures as arrangements of data in memory and algorithms as methods to manipulate this data. It discusses the application of these concepts in real-world data storage, programmer's tools, and modeling, as well as introducing object-oriented programming and software engineering principles. Key topics include the definitions of databases, records, fields, and the importance of object-oriented programming features such as inheritance and polymorphism.

Uploaded by

sabersediqi1380
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Data Structures &

Algorithms
Chapter 1: Overview

By: Mohammad Aman SULTANI


1398
2 IN THIS CHAPTER

 What Are Data Structures and Algorithms Good For?


 Overview of Data Structures
 Overview of Algorithms
 Object-Oriented Programming
 Software Engineering
3 Definition

 A data structure is an arrangement of data in a


computer’s memory (or sometimes on a disk). Data
structures include arrays, linked lists, stacks, binary trees,
and hash tables, among others.
 Algorithms manipulate the data in these structures in
various ways, such as searching for a particular data
item and sorting the data.
4 What sorts of problems can you solve with a
knowledge of these topics?

 Real-world data storage


 Programmer’s tools
 Modeling
5 Real-world data storage
 Many of the structures and techniques we’ll discuss are
concerned with how to handle real-world data storage.
 By real-world data, we mean data that describes
physical entities external to the computer.
 As some examples,
 a personnel record describes an actual human being,
 an inventory record describes an existing car part or grocery
item,
 and a financial transaction record describes, say, an actual
check written to pay the electric bill.
6 Programmer’s Tools

 Not all data storage structures are used to store real-world data.
 Typically, real-world data is accessed more or less directly by a
program’s user.
 Some data storage structures, however, are not meant to be
accessed by the user, but by the program itself.
 A programmer uses such structures as tools to facilitate some other
operation.
7 Real-World Modeling

 Some data structures directly model real-world


situations.
 The most important data structure of this type is the graph.
 You can use graphs to represent airline routes between cities
8 Algorithms

 Many of the algorithms we’ll discuss apply directly to


specific data structures.
 For most data structures, you need to know how to:
▪ Insert a new data item.
▪ Search for a specified item.
▪ Delete a specified item.
9 Some Definitions
 Database
 We’ll use the term database to refer to all the data that will be dealt with in
a particular situation.
 Record
 Records are the units into which a database is divided.
 They provide a format for storing information.
 Field
 A record is usually divided into several fields.
 A field holds a particular kind of data.
 Key
 To search for a record within a database, you need to designate one of the
record’s fields as a key (or search key).
10 Object-Oriented Programming

 OOP was invented because procedural languages,


such as C, Pascal, and early versions of BASIC, were
found to be inadequate for large and complex
programs.
 Why was this?
 There were two kinds of problems.
 One was the lack of correspondence between the program and
the real world,
 and the other was the internal organization of the program.
11 Object-Oriented Programming

 Object
 The idea of objects arose in the programming community as a
solution to the problems with procedural languages.
 An object contains both methods and variables.
 Classes
 A class is a specification—a blueprint—for one or more objects.
 Constructors
 a constructor, which is a special method that’s called
automatically whenever a new object is created.
 A constructor always has exactly the same name as the class
12 Object-Oriented Programming
 Inheritance
 Inheritance is the creation of one class, called the extended or derived class,
from another class called the base class.
 The extended class has all the features of the base class, plus some additional
features.
 For example, a secretary class might be derived from a more general employee
class and include a field called typingSpeed that the employee class lacked.
 Polymorphism
 Polymorphism involves treating objects of different classes in the same way. For
polymorphism to work, these different classes must be derived from the same
base class.
 For example, a call to display() for a secretary object would invoke a display
method in the secretary class, while the exact same call for a manager object
would invoke a different display method in the manager class.
13 Software Engineering

 Software engineering is the study of ways to create large


and complex computer programs, involving many
programmers.
 Software engineering is concerned with the life cycle of
a software project, which includes specification, design,
verification, coding, testing, production, and
maintenance.

You might also like