Wednesday, February 27, 2019

ABSTRACT DATA TYPE

Abstract Data Type(ADT)

            ADT  is  specification of a set of data and the set of operations that can be performed on the data.
  • Abstract  Data Type is an extension of modular design.
  • The basic idea of implementing  ADT is that the operation are written once in program and can be called by any part of the program.

Uses of ADT: 

  1.  It  helps  to efficiently develop  well defined program.
  2.  Facilitates the splitting of the complex task into a number of similar sub-task and also simplifies testing and debugging.


List ADT:

              List is an ordered set of elements. the general form of the list is

    A1, A2,A3,......AN.

              A1   - First element of the list.
              AN Last element  of the list.
                    N  Size of the list.

       If the element at position 'i'  is  Athen its successor is  Ai+1   and its predecessor  is Ai-1.

Various operations performed on List:

  1. Insert(X,5)     - Insert the element X  after the position 5.
  2. Delete (X)      -The element X is deleted.
  3. Find (X)         -Return the position of X.
  4. Next(i)            - Return the position of its successor element i.
  5. Previous(i)     - Return the position of its predecessor i-1.
  6. Print List       -Content of the list is displayed.
  7. Make empty  -Make the list empty.
                                      ************






                                                                                                                     


No comments:

Post a Comment