KnowledgeBoat Logo

Computer Science

Assertion (A): Stack and Queue are linear data structures.

Reasoning (R): List, tuples and dictionaries are Python built-in linear data structures.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Stack

1 Like

Answer

A is true but R is false.

Explanation
Stacks and queues are linear data structures because they organize data elements in a linear order, allowing elements to be accessed in a sequential manner. Python provides built-in data structures like lists, tuples, and dictionaries. Lists and tuples are examples of linear data structures as they store elements in a specific linear order, while dictionaries are non-linear data structures because they do not maintain a specific linear order, and elements are accessed based on their keys rather than indices.

Answered By

1 Like


Related Questions