19.5k views
1 vote
)In a vector implementation of a stack ADT, you add an entry to the top of a stack using which vector method?

A. Push

B.add

C.none of the other answers

1 Answer

2 votes

Answer:

B.add.

Step-by-step explanation:

boolean add(element)

The add method in java inserts an element in the vector.It's return type is Boolean it returns true if the element is successfully inserted in the vector and false if the operation is unsuccessful.There is no Push operation in vector.Hence we conclude that the answer is add.

User Eugen Konkov
by
6.4k points