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

Classification of DS

pdf
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)
11 views13 pages

Classification of DS

pdf
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

CSE-281: Data Structures and Algorithms

Classification of Data Structure

Eftekhar Hossain
Ref: Online Resource Assistant Professor
Dept. of ETE, CUET
1
Data Structure

❑ Data Structure is a way of collecting and


organizing data in such a way that we can
perform operations on these data in an effective
way...

❑ Searching data.

❑ Need to manage processor speed.

❑ Serve multiple request simultaneously.

2
Characteristics of a Data Structure

❑ Time Complexity - Running time or the execution


time of operations of data structure must be as
small as possible.
❑ Space Complexity - Memory usage of a data
structure operation should be as little as possible.
.

3
Execution Time Cases
There are three cases which are usually used to compare
various data structures execution time :

❑ Worst Case — when a particular data structure operatio


n takes maximum time.

❑ Average Case — This is the scenario depicting the


average execution time of an operation of a data
structure.

❑ Best Case — This is the scenario depicting the least


possible execution time of an operation of a data
structure.
4
Types Of Data Structures

➢ Primitive data structures

➢ Non-primitive data structure


➢ Linear DS

➢ Non Linear DS

➢ Primitive Data Structures are the basic data structures that


directly operate upon the machine instructions.

Example: int , float, char, and pointer

5
Types Of Data Structures

Non-primitive Data Structures

➢ are more complicated data structures and are derived from


primitive data structures.

➢ emphasize on grouping same or different data items with r


elationship between each data item.

➢ Example : Array, List

6
Types Of Data Structures

Linear DS:

➢ every item is related to its previous and next time.

➢ data is arranged in linear sequence.

➢ data items can be traversed in a single run.

➢ implementation is easy

Example: Stack , Queue

7
Types Of Data Structures

Non-linear DS:

➢ every item is attached with many other items.

➢ data is not arranged in sequence.

➢ data cannot be traversed in a single run.

➢ implementation is difficult.

Example: Tree, Graph

8
Static and Dynamic DS

Static

➢ Static data structures are those whose sizes and structures


associated memory locations are fixed at compile time.
Example: Array

Dynamic

➢ Dynamic structures are those which expands or shrinks


depending upon the program need and its execution. Also,
their associated memory locations changes.
Example: Linked List created using pointers
9
Cont.

Homogeneous

➢ In homogeneous data structures, all the elements are of


same type.

Example: Array

Non-Homogeneous

➢ In Non-Homogeneous data structure, the elements may or


may not be of the same type.

Example: Structures
10
What is an Algorithm?

➢ A process or set of rules to be followed in calculations or


other problem-solving operations, especially by a computer.

Formal Definition :

➢ An algorithm is a finite set of instructions that are carried in


a specific order to perform specific task.

11
Algorithm Characteristics

➢ Algorithms typically have the following characteristics

➢ Inputs : 0 or more input values.

➢ Outputs : 1 or more than 1 output.

➢ Unambiguity : clear and simple instructions.

➢ Finiteness : Limited number of instructions.

➢ Effectiveness : Each instruction has an impact on the overall


process.

12
Thank You

You might also like