0% found this document useful (0 votes)
10 views27 pages

Lecture 01 Intro

The document outlines the course structure for COSC-2101: Data Structures & Algorithms taught by Dr. Humaira Anwer, detailing the course contents, assignment policies, grading weightage, and honor code. It covers various data types, data structures, and their classifications, as well as the objectives of the course aimed at developing students' understanding of efficient data organization. The document emphasizes the importance of selecting appropriate data structures for problem-solving and provides a real-life example of an electronic phone book to illustrate these concepts.

Uploaded by

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

Lecture 01 Intro

The document outlines the course structure for COSC-2101: Data Structures & Algorithms taught by Dr. Humaira Anwer, detailing the course contents, assignment policies, grading weightage, and honor code. It covers various data types, data structures, and their classifications, as well as the objectives of the course aimed at developing students' understanding of efficient data organization. The document emphasizes the importance of selecting appropriate data structures for problem-solving and provides a real-life example of an electronic phone book to illustrate these concepts.

Uploaded by

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

Lecture 01

Introduction
Data Structures & Algorithms
COSC-2101

Dr.. Humaira Anwer


[email protected]

Institute of Computer Science


Khwaja Fareed UEIT

1
Administrative
• Instructor: Ms. Humaira Anwer
[email protected]
• ICT Building, Office: 2nd Floor COSC-3.08
• Email: [email protected]
http://www.niit.edu.pk/~azhar
• Consulting hours:
• 800 hrs. to 1000 hrs.
• Email me and get in touch if in need
• Regularly check course folder on LMS

2
Course Contents
• Data Types
• Overview, Introductory concepts
• Data Types, meaning and implementation
• Abstract data types (ADT)
• Arrays (revisited)
• Linked Lists
• Stacks
• Queues
• Trees (traversals, implementation)

3
Course Contents
• Binary Trees (BTs)
• Binary Search Trees (BSTs)
• Balanced Search Trees
• (AVL Tree)
• Recurssion
• Towers of Hanoi
• Indexing Methods
• Hashing
• Heaps
• Graphs
4
Text book
• Reference Books:
• Data Structures and Algorithm Analysis, Mark Allen Weiss,
Florida International University, Addison-Wesley (latest
Edition)

• Data Structures and Algorithm Analysis, Edition 3.2 (Java


Version) Clifford A. Shaffer, Department of Computer Science,
Virginia Tech, Blacksburg, VA 24061

• Data Structures: Abstraction and Design Using Java, Koffman


and Wolfgang, Wiley; 2nd Edition (or latest
Edition)://www.brpreiss.com/books/opus4/html/book.htm
• Any other book on Data Structures

5
Assignment Policy
• DO NOT copy assignments
• Both of the copy cases will be graded zero
• Submission time will be 1500 hrs on the due date
• NO credit on LATE submission of any deliverable.
• No excuse of USB/Floppy/email servers not working
• Sorry! No Exceptions

6
Weightage
• Mid Exam 25%
• Quizzes 10%
• Assignments 10%
• Attendance 5%
• Final Exam 50%

• Minimum Quizzes : 5-6 (Unannounced)


• Assignments : 1 Every 2 weeks

7
Honor Code
• Dishonesty will NOT be tolerated.
• Will result in zero marks in the corresponding work
• Cell Phones should be TURNED OFF during class

8
Lets start the course!

9
Today’s Agenda
• Purpose of Studying Data Structures (DS)
• Objectives of Course
• Basic Terminologies
• Real Life Example
• Data Types
• Primitive & Non-Primitive Data Types
• Abstract Data Types (ADTs)
• Classification of Non-Primitive Data Types
• Linear & Non-Linear DS
• Static & Dynamic DS
• Homogenous & Non-Homogenous DS
• Operations on DS
• Goals of DS
• Selection of Appropriate DS
10
Purpose
• Designed to develop students understanding the
impact of structuring data to achieve efficiency of
a solution to a problem

• After completion you will be familiar with


important and most often used data structuring
techniques.

• It will enable you to understand the manner in


which data is organized and presented later.

11
Objectives of the Course
• Present in a systematic fashion the most commonly
used data structures, emphasizing their abstract
properties.
• Discuss typical algorithms that operate each kind of
data structure, and analyze their performance.
• Compare different Data Structures for solving the
same problem, and choose the best

12
Introduction
• Data: Information processed or stored by
a computer.
• Structure: Way of organizing information, so that it
is easier to use.
• Data Structure: Its a particular way of organizing
data in a computer so that it can be used efficiently.

13
A Real Life Example
Electronic Phone Book • Lisa
Contains different DATA: • Michele
- names • John
- phone number • 110
- addresses • 622-9823
Need to perform certain OPERATIONS: • 112-4433
- add • 75
- delete • Bronson
- look for a phone number • Paola
- look for an address

How to organize the data so to optimize the


efficiency of the operations

14
Data Types
• Data type is way to classify various types of data
such as:
• integer
• float
• char
• String
• bool
• It determines values that can be used with the
corresponding type of data.

15
Classification of Data
Structure

16
Primitive & Non
Primitive Data Types
• Primitive data type

• Non Primitive data type

17
Abstract Data Types (ADTs)
• ADT is a mathematical model that gives a set of
utilities available to the user but never states the
details of its implementation.

• In OO-Programming a Class is an ADT

18
Classification of Data Structures
(Non-Primitive Data Types)
• There are various ways to classify data
structures (non-primitive Data Types):
– Linear & non linear data structures
– Static and dynamic data structures
– Homogenous and non homogenous(Hetrogenous)
data structures.

19
Linear & Non Linear Data Structures
Non-
Primitive
DS

Linear Non Linear

Main difference between linear and nonlinear data


structures lie in the way they organize data elements.

20
Linear Data Structures
• Those data structures where the data elements are
organized in some sequence are called linear data
structures.

• In linear data structures, the elements are stored in non-


hierarchical way where each element has the successors
and predecessors except the first and last element.

• Examples of linear data structures are:


– Arrays
– Stacks
– Queues
– Linked list.

21
Non Linear Data Structures
• When the data elements are organized in
some arbitrary function without any
sequence, such data structures are called non-
linear data structures.
• Examples are:
– Trees
– Graphs
– Heaps

22
Static and Dynamic Data Structures
Static Dynamic
Memory is allocated at the compile time. Memory is allocated to data structure at
Fixed size. the run time(dynamically) i.e. as the
program executes
The program/ memory management can Can extend as far as physically possible.
allocate fixed amount of memory. More flexible.
Sets aside memory regardless of whether Makes the most efficient use of memory
it is needed or not. Very inefficient. as the data structure only uses as much
memory as it needs.
Memory wastage. No wastage of memory.
Memory is allocated sequentially. Memory is not allocated sequentially.
Easier to program as there is no need to Harder to program as software needs to
check on data structure size at any point. keep track of its size and data item
locations at all times.
Arrays are examples of static data Linked lists are examples of dynamic data
structures. structures.

23
Homogenous & Non Homogenous
Data Structures
• In homogenous data structure, all the
elements are of same type. For Example:
arrays.

• In non-homogenous (heterogeneous) data


structure, the elements may or may not be of
the same type. For Example: Records.

24
Operations on Data
Structure
• Traverse
• Display
• Insert/Add
• Delete/Destroy/Remove
• Select
• Search
• Sort
• Merge
• Peek
25
Goals of Data structures
• Identify and develop useful mathematical entities
and operations and to determine what classes of
problems can be solved by using these entities and
operations.

• Determine representation of those abstract entities


and to implement the abstract operation on these
concrete representations.

26
Selecting A Data Structure
• Analyze the problem.

• Determine the basic operations that must be


supported.

• Quantify the resource constraints for each operation.

• Select the data structure that best meets these


requirements.

27

You might also like