27,832 views
57 57 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

9 Answers

Best answer
75 75 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
14 14 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

6 6 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
3 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.
0 0 votes

Option B is false.

Some algorithms need to create new instances of some ADT (such as new variables, or new stacks). To describe such algorithms, one usually includes in the ADT definition a create() operation that yields an instance of the ADT, usually with axioms equivalent to

  • the result of create() is distinct from any instance in use by the algorithm.

This axiom may be strengthened to exclude also partial aliasing with other instances. On the other hand, this axiom still allows implementations of create() to yield a previously created instance that has become inaccessible to the program.

https://en.wikipedia.org/wiki/Abstract_data_type

Answer:
Position:
Show:

Related questions

200 200 votes
9 answers 9 answers
79.3k
79.3k views
Kathleen asked Sep 22, 2014
79,310 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
32 32 votes
3 answers 3 answers
15.5k
15.5k views
gatecse asked Sep 21, 2014
15,531 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...
33 33 votes
9 answers 9 answers
30.9k
30.9k views
Kathleen asked Sep 22, 2014
30,871 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)...
50 50 votes
6 answers 6 answers
39.9k
39.9k views
Kathleen asked Sep 22, 2014
39,903 views
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$42$