1.1.3 Types of Data Structure:

Primitive and Non primitive data structures:
  1. Primitive- It is a set of elements which do not involve any other elements as its sub parts. i.e the types which directly operate on data types.
  2. Non-primitive data structures- It is a set of derived elements such as array, files etc. 
It is further divided into two types: Linear and nonlinear data structures.
  1. Linear Data Structures- in which all elements form a sequence or maintain a linear ordering. Every data element has unique successor and unique predecessor.
  2. Non-Linear Data Structure- are used to represent the data containing hierarchical or network relationship between the elements. Every data element may have more than one predecessor as well as successor.   
Classification: Linear             Non – Linear

                            Example: -        Example: -
                         •Linear List       • Graph
                         •Stack                •Tree
                         •Queue
 

Characteristics of Data Structures:

Data Structure

Advantages

Disadvantages

Array

Quick inserts
Fast access if index known

Slow search
Slow deletes
Fixed size

Stack

Last-in, first-out access

Slow access to other items

Queue

First-in, first-out access

Slow access to other items

Linked List

Quick inserts
Quick deletes

Slow search

Binary Tree

Quick search
Quick inserts
Quick deletes
(If the tree remains balanced)

Deletion algorithm is complex

Hash Table

Very fast access if key is known
Quick inserts

Slow deletes
Access slow if key is not known
Inefficient memory usage

Graph

Best models real-world situations

Some algorithms are slow and very complex

 

0 Comments:

Post a Comment