Skip to main content

Data Structure & its types:-

  The logical or mathematical model of a particular organisation of data is called data structure. It is the representation of the logical relationship existing between individual elements of the data.
  In other words data structure is collection of data elements whose organisation is characterized by accessing operations that are used to store and retrieve the individual data elements.

 A data structure mainly specifies the following things:-
   i> Organisation of data.
  ii> Accessing methods.
 iii> degree of associativity.
 iv> Processing alternative code for information.

* Data structure is the basic building blocks of the program.


* |The data structure is of two types:-
 1. Primitive data structure.
 2. Non-Primitive data structure.

1. Primitive data structure:-
   These are the basic data structures and they are directly operated by a machine instructions.
      In general they have different representations for different computers. It is also known as built-in-data structure. Ex- integer , character , float , pointer.

2. Non-Primitive data structure:-
    They are derived from the primitive data structure. The non-primitive data structures emphasized on a grouping of homogeneous or hectogeneous data items. It is also known as user-defined data structure. Ex- array , list , files.


*Lists are further  categorised  into two categorises :-
A. Linear
B. Non -Linear





* Integer:-  Integers are a commonly used data type in computer programming.When two integers are added, substracted or multiplied , the result is also  an integer. An integer is a whole number that can be positive , negative or zero. It takes 2 byte space in memory.


* Float:-  It is used in programming language to define a variable with a factorial value.Numbers created using a float variable declaration will have digits on both sides of a decimal point. It takes 4 byte space in memory.


* character:-  A single character can be defined as character type data. Characters are usually stored in 1 byte of internal storage.


* Pointer:- Pointer is data type which denotes the address of another variable. To declare a pointer variable we have to use data type and an indirection operator  (*) before the variable name.

* Array:-  An array is a variable, which has several pockets and each pockets can contains similar data type. This is the simplest type of data structure. By a linear array we mean a list of finite number 'n' of similar data elements referenced respectively by a set of n numbers usually 1,2,3,.........n.


 * List:-  A list or is an abstract data type that represents a countable number of ordered values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence.



 * Files:-  A file contains data which are stored permanently in a storage device. A file  stored in a storage device is always identifying using a file name.Files are further in  to two types on the basis of data stored :-
 a. Data files.
 b. Text files.


 * Stack:-  A stack is a non-primitive linear data structure. It is an ordered list where the
 addition of new data elements and deletion of existing data element is done by only one end called Top of the stack.
   It is the last-in-first-out  or first-in-last-out type of list.
   The insertion or addition of data elements into the stack is called push operation and deletion of the existing data element is called pop operation.


 * Queue:-  A queue is also non-primitive linear data  structure.   It is the first -in-first-out system of list. In queue deletion can take place at one end of the list , the Front of the list.And insertion can take place only at the other end of the list , Rear of the list.


* Graph:-  A graph data structure consists of a finite set of vertices or nodes or points, together with a set of unordered pairs of these vertices for an undirected graph or a set of ordered pairs for a directed graph. Data sometime contain a relationship between pair of elements which is not necessary hierarchical in nature.


 * Tree:-  Data frequently contains a hierarchical relationship between various elements . The data structure which reflects this relationship is called a rooted tree graph or simply a tree.




           Read , share and comment  😄

Comments

Post a Comment

Please comment.

Popular posts from this blog

Process Scheduling And Types of Process Schedular :-

        ⇰ PROCESS SCHEDULING Process Scheduling  is a task  of Operating System that schedules processes of different states like new, ready, waiting, terminated  and running.This scheduling helps in allocation of CPU time for each process, and Operating System allocates the CPU time for each procss. And the process scheduling plays important role to keep the CPU busy all the time.  ⏩   Followings are some objectives of Process Scheduling :-  i > To increase the amount of users within acceptable response times.  ii > To maintain the balance between response and utilization of system. iii > To decrease the enforce priorities and  give reference to the processes holding the key resources.      ⇰  PROCESS SCHEDULAR A scheduler carries out the pro cess scheduling work. Schedulers are often implemented so they keep all computer resources busy and  allows multiple users to shar...

Process & Its state And process control block :-

                ⇰  PROCESS :- A process can be thought of as a program in execution. Means when any program is executed it becomes process. A processwill need certain resources such as CPU time , memory, files and I/O devices to complete its task. These resources are allocated to the process either when it is created or at the time of execution.             A process is the unit of work in most systems. A system consistes of a collection of processes. All these processes may execute concurrently. Traditionally a process contained only a single thread. Most modern operating ststems now supports processes that have multiple threads.         The operating system is responsible for several important works of process management as - the creation and deletion of process, the schrduling of process, communication and deadlock handling of process. Process is broudly divided into two ...

Tokens and its types in 'C'

   Tokens are the smallest individual unit of a program or in simple words it is a main part of C program.Tokens are the building blocks of any program. The smallest individual and basic unit of a C programming is called c tokens.      *    Normally there are six types of tokens in C:- i> Keywords:-          Keywords are special words that are used to give a special meaning to the program and can't be used as variable and constant.They are basically a sequence of characters that have fixed to mean. For example:-                 auto     double      long     break                 float    short        char     if                while    continue   int       void etc. All...