Data structure answers
Data structure answers
• A Data Structure is a way to organize, manage, and store data in a way that enables
efficient access and modification.
• Linear Data Structures: Elements are arranged sequentially, and each element has a
single successor and predecessor (except the first and last).
o Examples: Arrays, Linked Lists, Stacks, Queues
• Non-Linear Data Structures: Elements are not arranged in a sequential manner; they
can have multiple relationships.
o Examples: Trees, Graphs
• ADT (Abstract Data Type) is a mathematical model for data types, defining the
behavior (operations) but not implementation details.
• Example: A Stack ADT defines operations like push(), pop(), peek(), but doesn’t
specify if it’s implemented using an array or linked list.
Example: 5 3 + 8 2 - *
Steps:
• A B + C *
Steps:
1. 10 + 5 = 15
2. 60 / 6 = 10
3. 15 * 10 = 150
4. 150 - 8 = 142
Result: 142