Data Structure and Algorithm
Lecture Division
Week No . 1
Audience:
BSCS/BSIT 4th Semester
Instructor:
Muhammad Mukhtar Qureshi
Contact @ m_m_Qur@yahoo.com
Topic:
Introduction about Course
Discussion
 Course introduction and grading policy
 What is data structure
 Philosophy of data structure
 Memory organization
 Goal of the course
Assessments/Grading Policy
 Assignments 10%
 Quizzes 10%
 Mid 30%
 Final 50%
Friday,
January
19,
2024
4
Text Books
 Recommended Books
 Data Structures Using C++, By Author :D.S.Malik
 C++ Plus Data Structures Fifth Edition, Nell B. Dale (Author)
 Data Structures and Algorithms Analysis in C++, 3rd edition,
by Mark Allen Weiss
 Reference Books
 Data Structures and Algorithms in C++, 2ndEdition, Author:
Micheal T. Goodrich, Roberto Tamassia and David Mount John
Wiley and Sons, Inc
 Classic Data Structures, BySamanta Debasis(Author)
Friday,
January
19,
2024
5
What is Data Structure?
 In computer science, a data structure is a particular way of storing and
organizing data in a computer so that it can be used efficiently.
 The basic types of data structures include:
 Files, lists, arrays, records, trees, tables, graphs
Friday,
January
19,
2024
6
What is Algorithm?
 An algorithm is a generic, step-by-step list of instructions for solving a
problem. It is a method for solving any instance of the problem such that
given a particular input, the algorithm produces the desired result.
 A program, on the other hand, is an algorithm that has been encoded into
some programming language. There may be many programs for the same
algorithm, depending on the programmer and the programming language
being used.
7
Need for Data Structures
 Data structures organize data  more efficient programs.
 More powerful computers  more complex applications.
 More complex applications demand more calculations.
Need for Data Structures
 Data structures organize data  more efficient programs.
 More powerful computers  more complex applications.
 More complex applications demand more calculations.
Efficiency
 A solution is said to be efficient if it solves the problem within its
resource constraints.
 Space
 Time
 The cost of a solution is the amount of resources that the solution
consumes.
Selecting a Data Structure
Select a data structure as follows:
1. Analyze the problem to determine the resource constraints a
solution must meet.
2. Determine the basic operations that must be supported. Quantify
the resource constraints for each operation.
3. Select the data structure that best meets these requirements.
Some Questions to Ask
 Are all data inserted into the data structure at the beginning, or are
insertions interspersed with other operations?
 Can data be deleted?
 Are all data processed in some well-defined order, or is random
access allowed?
Data Structure Philosophy
 Each data structure has costs and benefits.
 Rarely is one data structure better than another in all situations.
 A data structure requires:
 space for each data item it stores,
 time to perform each basic operation,
 programming effort.
Memory Organization
 The memory that communicates directly with CPU is called main
memory.
 Devices that provides backup storage are called secondary memory.
 Only program and data currently needed by the processor resides in
main memory.
 All other information is stored in auxiliary (secondary) memory and
transferred to main memory when needed.
14
Memory Organization…
Friday,
January
19,
2024
15
Memory Organization…
 Memory is divided into fixed-size units called cells, and each cell is
associated with unique identifier called an address. These addresses are
the unsigned integers 0, 1, 2,……MAX.
 All access to memory are to a specified address, and we must always fetch
or store complete cell-that is, all the bits in that cell. The cell is the
minimum unit of access.
 The time it takes to fetch or store the contents of a cell is the same for all
the cells in memory.
Friday,
January
19,
2024
16
Memory Organization…
Friday,
January
19,
2024
17
Goals of this Course
1. Reinforce the concept that costs and benefits exist for every data
structure.
2. Learn the commonly used data structures.
 These form a programmer's basic data structure “toolkit”.
3. Understand how to measure the cost of a data structure or
program.
 These techniques also allow you to judge the merits of new data
structures that you or others might invent.
The END
Question and Answer
Friday,
January
19,
2024
19

Introduction of DSA||DATA STRUCTURE AND ALGORITHUM

  • 1.
    Data Structure andAlgorithm Lecture Division Week No . 1 Audience: BSCS/BSIT 4th Semester Instructor: Muhammad Mukhtar Qureshi Contact @ m_m_Qur@yahoo.com
  • 2.
  • 3.
    Discussion  Course introductionand grading policy  What is data structure  Philosophy of data structure  Memory organization  Goal of the course
  • 4.
    Assessments/Grading Policy  Assignments10%  Quizzes 10%  Mid 30%  Final 50% Friday, January 19, 2024 4
  • 5.
    Text Books  RecommendedBooks  Data Structures Using C++, By Author :D.S.Malik  C++ Plus Data Structures Fifth Edition, Nell B. Dale (Author)  Data Structures and Algorithms Analysis in C++, 3rd edition, by Mark Allen Weiss  Reference Books  Data Structures and Algorithms in C++, 2ndEdition, Author: Micheal T. Goodrich, Roberto Tamassia and David Mount John Wiley and Sons, Inc  Classic Data Structures, BySamanta Debasis(Author) Friday, January 19, 2024 5
  • 6.
    What is DataStructure?  In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.  The basic types of data structures include:  Files, lists, arrays, records, trees, tables, graphs Friday, January 19, 2024 6
  • 7.
    What is Algorithm? An algorithm is a generic, step-by-step list of instructions for solving a problem. It is a method for solving any instance of the problem such that given a particular input, the algorithm produces the desired result.  A program, on the other hand, is an algorithm that has been encoded into some programming language. There may be many programs for the same algorithm, depending on the programmer and the programming language being used. 7
  • 8.
    Need for DataStructures  Data structures organize data  more efficient programs.  More powerful computers  more complex applications.  More complex applications demand more calculations.
  • 9.
    Need for DataStructures  Data structures organize data  more efficient programs.  More powerful computers  more complex applications.  More complex applications demand more calculations.
  • 10.
    Efficiency  A solutionis said to be efficient if it solves the problem within its resource constraints.  Space  Time  The cost of a solution is the amount of resources that the solution consumes.
  • 11.
    Selecting a DataStructure Select a data structure as follows: 1. Analyze the problem to determine the resource constraints a solution must meet. 2. Determine the basic operations that must be supported. Quantify the resource constraints for each operation. 3. Select the data structure that best meets these requirements.
  • 12.
    Some Questions toAsk  Are all data inserted into the data structure at the beginning, or are insertions interspersed with other operations?  Can data be deleted?  Are all data processed in some well-defined order, or is random access allowed?
  • 13.
    Data Structure Philosophy Each data structure has costs and benefits.  Rarely is one data structure better than another in all situations.  A data structure requires:  space for each data item it stores,  time to perform each basic operation,  programming effort.
  • 14.
    Memory Organization  Thememory that communicates directly with CPU is called main memory.  Devices that provides backup storage are called secondary memory.  Only program and data currently needed by the processor resides in main memory.  All other information is stored in auxiliary (secondary) memory and transferred to main memory when needed. 14
  • 15.
  • 16.
    Memory Organization…  Memoryis divided into fixed-size units called cells, and each cell is associated with unique identifier called an address. These addresses are the unsigned integers 0, 1, 2,……MAX.  All access to memory are to a specified address, and we must always fetch or store complete cell-that is, all the bits in that cell. The cell is the minimum unit of access.  The time it takes to fetch or store the contents of a cell is the same for all the cells in memory. Friday, January 19, 2024 16
  • 17.
  • 18.
    Goals of thisCourse 1. Reinforce the concept that costs and benefits exist for every data structure. 2. Learn the commonly used data structures.  These form a programmer's basic data structure “toolkit”. 3. Understand how to measure the cost of a data structure or program.  These techniques also allow you to judge the merits of new data structures that you or others might invent.
  • 19.
    The END Question andAnswer Friday, January 19, 2024 19