SVAHSAHHHAHAH
SVAHSAHHHAHAH
Efficient data search and modification is crucial as data grows. Activity Test: Understanding Data Structures and Algorithms
Processor speed: Even with fast processors, inefficient data structures can
lead to slow program execution, especially with large datasets. 1. Multiple Choice Questions
Multiple requests: Handling simultaneous data requests efficiently is vital
for web servers and applications. 1. What does the term "data structure" refer to?
o a) A type of programming language
3. Characteristics of a Data Structure o b) A method to store and organize data
o c) A type of database
Correctness: Implementation should correctly perform operations. 2. Which data structure operates on the principle of Last In First Out (LIFO)?
Time Complexity: Execution time should be minimized. o a) Queue
Space Complexity: Memory usage should be efficient. o b) Stack
o c) Linked List
4. What is an Algorithm? 3. What is the primary purpose of studying algorithms?
o a) To understand programming languages
An algorithm is a step-by-step procedure to perform a task, ensuring a o b) To learn how to efficiently solve problems
correct and efficient solution. o c) To design user interfaces
Characteristics of an Algorithm: 4. What is a characteristic of an efficient algorithm?
o Unambiguous: Clear and precise steps. o a) Takes infinite time to execute
o Input/Output: Well-defined inputs and outputs. o b) Uses minimal resources
o Finiteness: Must terminate after a finite number of steps. o c) Produces unpredictable results
o Feasibility: Should be practical with available resources.
2. Short Answer Questions
5. Basic Data Structures
1. Explain in your own words why it’s important to choose the correct data
Linear Data Structures: Data is organized in a linear order. structure for a given problem.
o Arrays: Fixed-size, elements stored in contiguous memory 2. Define what an algorithm is and give an example of a real-life situation
locations. that could be solved using an algorithm.
o Linked Lists: Elements are linked using pointers. 3. Describe the difference between linear and non-linear data structures.
3. Practical Exercise
o Implement a stack with basic operations: push, pop, and display the top element.
Analyze Time Complexity: