Sunday, November 3, 2013

What is Abstract Data Type(ADT)?


Abstract Data Type:

       Let us consider Gmail.
       We can do lot of operation with Gmail such as Create Account, Signin, Compose, Send, etc.,

       We know the required details to Create an account.

       We know the required details to Signin to Gmail.

      We know the required details to Compose and Send mail.
     
      But we don't know how these operations are functioning in background.
            we don't know how Google team handling these operation to give you the required output.
               Implementation of operation is always hidden to the user.


      Let us assume Gmail as abstract data type. We can say Gmail is an object with operations such as create account, signin, compose, send, etc.,

Abstract Meaning:

           *  Existing in thought or as an idea but not having a physical or concrete existence.
              Consider something theoretically or separately from (something else).
                     * A summary of the contents of a book, article, or speech.

Abstratct Data Type:

            An abstract data type is a type with associated operations, but whose representation is hidden.
                * Objects such as lists, sets, and graphs, along with their operations, can be viewed as abstract data types.
                     * The basic idea is that the implementation of these operations is written once in the program, and any other part of the program that needs to perform an operation on the ADT can do so by calling the appropriate function.
                          * If for some reason implementation details need to change, it should be easy to do so by merely changing the routines that perform the ADT operations. This change, in a perfect world, would be completely transparent to the rest of the program.

Stack ADT:


Queue ADT:


Reference:

            Data Structures and Algorithm Analysis in C by Mark Allen Weiss.
            www.wikipedia.com

17 comments:

  1. Wow very well explained , easy to understand ! god bless

    ReplyDelete
  2. Thanks that is an easier way to understand this concept :)

    ReplyDelete
  3. Was going through alot of articles and then i came across this one. Thanks alot bro! (y)

    ReplyDelete
  4. really well explained and so easy to understand, thanks a lot

    ReplyDelete
  5. i read books and web sites and they even used similar examples to yours but it wasn't clear and much more complicated. Thank you for being the one who broke that cycle!

    ReplyDelete
  6. seriously helpful...thank you straight and clear concept.

    ReplyDelete
  7. I appreciate your efforts towards this. Also, it's clear and more connected with the real world(and things like stack and queue). Nicely done! Only one suggestion.. I hope you're trying to improve on your English (I understand it's not your first language)

    About CSR, I keep feeding stray dogs :)

    ReplyDelete