62.6k views
3 votes
Which of the following List ADT instances in C++ Use a doubly linked list in their implementation?

A. Forward list
B. Vector
C. Array
D. List

1 Answer

6 votes

Final answer:

The C++ List ADT instance that uses a doubly linked list is D. List. The Forward list is a singly linked list, the Vector uses a dynamic array, and Array is a static size collection.

Step-by-step explanation:

In C++, the List Abstract Data Type (ADT) instance that uses a doubly linked list in its implementation is D. List. Here's a brief overview of the options provided:

  • A. Forward list: This implements a singly linked list, which allows for sequential one-directional traversal.
  • B. Vector: This uses a dynamically resizing array, providing random access to elements.
  • C. Array: It is a static-size sequential collection that holds elements of the same type in contiguous memory allocation.
  • D. List: This is a sequence container that allows for efficient insertion and deletion of elements from anywhere in the container. The C++ standard template library (STL) List is implemented as a doubly linked list.

User Davyzhang
by
8.1k points