introduction to data structures, Slides of Data Structures and Algorithms

I explain types of data structures their composition, definition, methods, and algorithm.

Typology: Slides

2021/2022

Available from 10/30/2022

khadija-aslam-3
khadija-aslam-3 🇵🇰

1 document

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download introduction to data structures and more Slides Data Structures and Algorithms in PDF only on Docsity!

  • Lecture

Course Information

Textbooks  (^) Data Structures and Algorithm Analysis in C+

  • by Mark Allen Weiss Data Structures and Algorithms in C++ by Adam Drozdek Algorithms in C++ by Robert Sedgewick Data Structures and Abstractions with Java™ by Frank M. Carrano & Timothy M. Henry

Grading

Theory

Quizzes ----------------10% Assignments-----------10% Mid Term-------------- 30% Final-------------------- 50%

 Labs

Assignments/Exercises and Project------ 20% Mid term------------------------------ 30% Final----------------------------------- 20%

Classification of Data Structure?

Data structure is classified in two broad categories Primitive data structures Non-primitive data structures.

Basic Data Structure

Basic Data Structures Linear Data Structures (^) Non-Linear Data Structures Arrays Linked Lists Stacks Queues Trees Graphs Hash Tables

Selection of Data Structure

The choice of particular data model depends on two consideration: It must be rich enough in structure to represent the relationship between data elements The structure should be simple enough that one can effectively process the data when necessary

Types of Data Structure

Linear: In Linear data structure, values are arrange in linear fashion. Array: Fixed-size Linked-list: Variable-size Stack: Add to top and remove from top Queue: Add to back and remove from front Priority queue: Add anywhere, remove the highest priority

Type of Data Structures

Homogenous: In this type of data structures, values of the same types of data are stored. Array Non-Homogenous: In this type of data structures, data values of different types are grouped and stored. Structures Classes

Abstract Data Type and Data

Structure

Definition:-  (^) Abstract Data Types (ADTs) stores data and allow various operations on the data to access and change it.  (^) A mathematical model, together with various operations defined on the model  (^) An ADT is a collection of data and associated operations for manipulating that data Data Structures  (^) Physical implementation of an ADT  (^) data structures used in implementations are provided in a language (primitive or built-in) or are built from the language constructs (user-defined)  (^) Each operation associated with the ADT is implemented by one or more subroutines in the implementation

The Core Operations of ADT

Every Collection ADT should provide a way to: add an item remove an item find, retrieve, or access an item Many, many more possibilities is the collection empty make the collection empty give me a sub set of the collection

  • (^) No single data structure works well for all purposes, and so it is important to know the strengths and limitations of several of them

Queues

Collection with access only to the item that

has been present the longest

Last in last out or first in first out

enqueue, dequeue, front

priority queues and dequeue

Data1 Data2 Data3 Data Front (^) Back

List

A Flexible structure, because can grow and shrink on demand. Elements can be:  (^) Inserted  (^) Accessed  (^) Deleted At any position first last