R
Rishtaara
Computer Science · Class 12

Data Structures and Algorithms

Learn Data Structures and Algorithms with notes, examples, and practice questions.

3 sections15–25 min read6 MCQs · 2 examples

Chapter Overview

Data Structures and Algorithms teaches problem-solving using algorithms — step-by-step logic, flowchart symbols, and pseudocode before writing programs.

Algorithms

  • Finite steps to solve a problem
  • Must be clear, unambiguous, finite
  • Examples: search, sort, find max

Flowchart Symbols

  • Oval: Start/End
  • Parallelogram: Input/Output
  • Rectangle: Process
  • Diamond: Decision (yes/no)
  • Arrows show flow direction

Solved Examples

Step-by-step solutions — read each step before checking the final answer.

Find largest

Algorithm to find largest of three numbers a, b, c.

  1. 1Assume max = a
  2. 2If b > max, max = b
  3. 3If c > max, max = c
  4. 4Print max

Answer

Compare pairwise

Decision symbol

Which symbol is used for 'if marks > 40'?

  1. 1Decision uses diamond shape
  2. 2Two paths: Yes and No

Answer

Diamond (decision)

Key Points to Remember

  • Every algorithm has start and end
  • Avoid infinite loops in flowcharts
  • Test with sample values

Exam Tips

  • Draw flowchart for given problem
  • Know all standard symbols
  • Write pseudocode before code

Practice MCQs — Data Structures and Algorithms

Test your understanding with topic-wise multiple choice questions. Explanations appear after each answer.

Question 1 of 6Score: 0/0

Algorithm must be: