CrazyEngineers
  • Abstract data type

    radha gogia

    radha gogia

    @radha-BTDzli
    Updated: Oct 23, 2024
    Views: 1.3K
    I just have little confusions regarding the term abstract data type,although I have gone through google several times ,but still not yet satisfied .
    Firstly , why is this called a data type ,when we have actual implementation of the abstract data type as a data structure ,then why to use the term data type?

    Secondly,I came across through this statement while studying "ADT CAN BE IMPLEMENTED USING DATA TYPE OR DATA STRUCTURE" ,what is the meaning of this line?

    I am actually not getting out that are all data structures referred to as a data type because in C we say that a structure is both a data type and a data structure ,so actually how the stuff works?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Koushal Patel

    MemberJan 5, 2015

    I want to explain with an example. In our country, we have chain restaurants. Consider the example of a food chain which Sells food X. Suppose, Mumbai is the center office and Pune, Nashik, Nagpur are branch offices. "How the food X is prepared" defined at Mumbai. Pune, Nashik and Nagpur chains are only going to follow the protocol and prepare food X at their local places.

    Food X is ADT. Food X at Pune, Nashik and Nagpur are sub types.

    Anyone, correct me if i am wrong. 😀

    ADT is helpful because
    1. I only need to handle specifics at one place. Changes are easier to do and track. - Less motions of repeating myself.
    2. Our main focus would be on what to do, rather than how to do. - Provides level of abstraction.
    Are you sure? This action cannot be undone.
    Cancel
  • radha gogia

    MemberJan 6, 2015

    Please Can you be specific to my question ,I already know what an ADT is my question is something else ,please try to clearly understand my question.
    Are you sure? This action cannot be undone.
    Cancel
  • Anoop Kumar

    MemberJan 6, 2015

    I never learned about Abstract Data Type till now☕.
    Do you have confusion about following?
    <a href="https://docs.oracle.com/javase/tutorial/collections/intro/" target="_blank" rel="nofollow noopener noreferrer">Lesson: Introduction to Collections (The Java™ Tutorials > Collections)</a>
    • Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.
    or see this:
    #-Link-Snipped-#

    I didn't find ADT term other than collection framework or any confusion here.
    Let me know if you talking about these and you still have confusion. I will clarify.
    Are you sure? This action cannot be undone.
    Cancel
  • radha gogia

    MemberJan 6, 2015

    Anoop Kumar
    I never learned about Abstract Data Type till now☕.
    Do you have confusion about following?
    <a href="https://docs.oracle.com/javase/tutorial/collections/intro/" target="_blank" rel="nofollow noopener noreferrer">Lesson: Introduction to Collections (The Java™ Tutorials > Collections)</a>

    or see this:
    #-Link-Snipped-#

    I didn't find ADT term other than collection framework or any confusion here.
    Let me know if you talking about these and you still have confusion. I will clarify.
    Sir ,I just have confusion that why is this called a data type ,I mean the concrete implementation of an ADT is a data structure ,so what is the logic behind calling it an abstract data type.
    Even the pic here shows that data structure is divided into 2 categories wherein one category is of primitive data types ,so I am confused in this that when to call a particular entity as a DATA TYPE and when to call it a DATA STRUCTURE ,and why is Abstract data type referred to as data type and not abstract data structure ?
    Are you sure? This action cannot be undone.
    Cancel
  • radha gogia

    MemberJan 6, 2015

    Here is the pic ..
    Are you sure? This action cannot be undone.
    Cancel
  • Anoop Kumar

    MemberJan 6, 2015

    Ok, here is the thing. I am not sure why they call it primitive and non-primitive.
    From your flow chat. data type and data structure looks same as they stores some kind of data.

    What does a data type does. Stores a data right.
    So, calling a data structure as xyz-data-type seems logical to me.
    Now, what is ADT.
    Take example of java. A List type stores a data but it's not concrete class. List is a interface. actual implementation is ArrayList and Vector.
    So calling List as Abstract Data Type looks good.
    Same apply to Set as ADT and HashSet/LinkedHashSet as actual data type.
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberJan 6, 2015

    radha gogia
    Firstly , why is this called a data type ,when we have actual implementation of the abstract data type as a data structure ,then why to use the term data type?
    ADT is called data type because in behaviour, it is a data type, As using integer type we create integer variables, similarly using List we create several list variables.
    radha gogia
    Secondly,I came across through this statement while studying "ADT CAN BE IMPLEMENTED USING DATA TYPE OR DATA STRUCTURE" ,what is the meaning of this line?
    This line is about the implementation of ADT, for example if we want to implement real numbers as ADT, we can simply use data type float and proceed with the implementation, or we can use an array(a data structure) of characters which will store our real numbers and a decimal(if present) and then we'll define operations. So in the first case we implemented using data type , while in second using data structure.
    radha gogia
    I am actually not getting out that are all data structures referred to as a data type because in C we say that a structure is both a data type and a data structure ,so actually how the stuff works?
    Yeah, structure in C is both
    Structure is a data type : as we can define variables for a particular structure.
    Eg if we have:
    struct book{
    char name[10];
    int cost;
    };
    :
    :
    book new_book; // see, we defined a variable using book [B]DATA TYPE[/B]
    
    Structure is a data structure as it is a collection of data types.
    Well the reply got too long 😁
    Hope it helps 😀[/QUOTE][/QUOTE]
    Are you sure? This action cannot be undone.
    Cancel
  • radha gogia

    MemberJan 6, 2015

    rahul69
    ADT is called data type because in behaviour, it is a data type, As using integer type we create integer variables, similarly using List we create several list variables.

    This line is about the implementation of ADT, for example if we want to implement real numbers as ADT, we can simply use data type float and proceed with the implementation, or we can use an array(a data structure) of characters which will store our real numbers and a decimal(if present) and then we'll define operations. So in the first case we implemented using data type , while in second using data structure.

    Yeah, structure in C is both
    Structure is a data type : as we can define variables for a particular structure.
    Eg if we have:
    struct book{
    char name[10];
    int cost;
    };
    :
    :
    book new_book; // see, we defined a variable using book [B]DATA TYPE[/B]
    
    Structure is a data structure as it is a collection of data types.
    Well the reply got too long 😁
    Hope it helps 😀
    [/QUOTE][/QUOTE]
    Ok Ok ,so does it mean that all data structures are data types but all data types are not data structures so what should be the necessary and sufficient condition for an entity to be a data type so that it is differentiated from data structure.
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberJan 7, 2015

    radha gogia
    Ok Ok ,so does it mean that all data structures are data types but all data types are not data structures so what should be the necessary and sufficient condition for an entity to be a data type so that it is differentiated from data structure.
    The condition is that if the implementation of data type using data structure is abstracted, then it is not a data structure (but an Abstract Data Type).
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register