19,323 views
43 votes
43 votes

An Abstract Data Type (ADT) is:

  1. same as an abstract class
  2. a data type that cannot be instantiated
  3. a data type for which only the operations defined on it can be used, but none else
  4. all of the above

8 Answers

Best answer
62 votes
62 votes

An abstract data type (ADT) supports only the operations which are defined.

Abstract class is one that may not have definitions of all the objects it have. Moreover it can not be instantiated. To instantiate we have to create a subclass then instantiate the class.

Abstract Data Type is  like data structure  eg. $STACK$ where we have $PUSH()$ $POP()$ operation defined .

Hence, they are not the same thing.

http://www.devx.com/tips/Tip/5681

Correct Answer: $C$

edited by
11 votes
11 votes

ADT of any data structure is "what operation stacks you can perform on this data structure."

for ex:

ADT of stack:

(1) push()

(2) pop()

ADT of queue:

(1) enqueue

(2) dequeue

3 votes
3 votes
Correct answer will be C) A data type for which only the operation defined on it can be used but none else.

Stack is Abstract Data Type, We can not perform any other operation on stack other that push() and pop() operation.
2 votes
2 votes

See link: https://www.devx.com/tips/Tip/5681 

An abstract class is a class that has at least one pure virtual member function. It is not a data type (normally, abstract classes do not contain any data members), nor can you instantiate an object thereof. An abstract class is merely a skeletal interface, which specifies a set of services that its subclasses implement.

This clears why option a) is incorrect.

 An abstract data type (also called a concrete type) is a self-contained, user-defined type that bundles data with a set of related operations. It behaves in the same way as a built-in type does. However, it does not inherit from other classes, nor does it serve as the base for other derived classes. Some examples of abstract data types or concrete types include std::string, std::complex, and std::vector.

 We can instantiate abstract data type or concrete type as all operations are defined on it. For example, in C++ you can instantiate the abstract data type string by:

std::string mystring = “Hello World”;


So option B) is false. 

Also see: https://wikipedia.org/wiki/Abstract_data_type

In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (semantics) from the point of view of a user, of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations.

So option c) is correct.

edited by
Answer:

Related questions

22 votes
22 votes
8 answers
1
Kathleen asked Sep 22, 2014
22,968 views
In a complete $k$-ary tree, every internal node has exactly $k$ children. The number of leaves in such a tree with $n$ internal node is:$nk$$(n-1)k + 1$$n(k-1) +1$$n(k-1)...
31 votes
31 votes
4 answers
2
Kathleen asked Sep 22, 2014
24,243 views
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$42$
20 votes
20 votes
1 answer
3
Kathleen asked Sep 22, 2014
13,930 views
A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10, 8, 5, 3, 2$. Two new elements $1$ and $7$ ar...
22 votes
22 votes
3 answers
4