Parho

Class 12 Computer Science · Chapter 2

Chapter 2: Computational Thinking & Algorithms

Class 12 Computer Science notes for the Punjab textbook: the chapter in short, the points to remember, the definitions and the formulas, with questions and tests.

  • 5 definitions
  • 6 key points
  • 1 formula

Chapter 2

All notes and resources

Pick one; the notes are on this page, the rest open their own page.

SummaryThe chapter in shortWhat the chapter is about, in a few paragraphs.Open Revision6 key pointsThe points to remember before the paper.Open Definitions5 definitionsIn exam wording, numbered for quick revision.Open Formulas1 formulaEvery formula you need for the numericals.Open TestChapter tests3 tests, marked the moment you finish.Open
Coming soonNotes PDFThe whole chapter's notes as a PDF to keep.
Coming soonExercise solutionsThe textbook exercise, solved step by step.
Coming soonShort questionsShort questions with their answers.
Coming soonLong questionsLong questions with full answers.
Coming soonMCQs PDFMultiple-choice questions with the answer key.
Coming soonNumericalsNumerical problems, worked out.

The chapter in short

Computational thinking breaks problems into parts, finds patterns, abstracts away detail and designs algorithms. The chapter applies these skills to designing and analysing algorithms.

It covers algorithm design strategies, recursion, searching and sorting, and measuring efficiency with Big-O notation.

Computational thinkingRecursionBase caseDivide and conquerBig-O notation

Key points

  • Computational thinking: decomposition, pattern recognition, abstraction and algorithm design.
  • Recursion solves a problem by calling itself on a smaller case, with a base case to stop.
  • Merge sort and quick sort divide and conquer; they are faster than bubble sort on large lists.
  • Binary search needs sorted data and runs in O(log n).
  • Big-O describes worst-case growth of running time.
  • Choosing the right algorithm matters more than faster hardware for large inputs.

Definitions

  1. 1

    Computational thinking

    A problem-solving method using decomposition, patterns, abstraction and algorithms.

  2. 2

    Recursion

    A function calling itself to solve smaller instances of a problem.

  3. 3

    Base case

    The condition that ends recursion.

  4. 4

    Divide and conquer

    Solving a problem by splitting it into smaller subproblems.

  5. 5

    Big-O notation

    A way of describing how an algorithm's running time grows.

Formulas

Recursive factorial

def fact(n): return 1 if n == 0 else n * fact(n - 1)

Ready to test chapter 2?

Answer the chapter's questions and see your marks the moment you finish.

Take the test

Parho for Android is coming

Join early access and be the first to get the app: tests, notes and solutions on your phone.

FAQ

Questions students ask

What is Class 12 Computer Science chapter 2 about?

Computational thinking breaks problems into parts, finds patterns, abstracts away detail and designs algorithms. The chapter applies these skills to designing and analysing algorithms.

Which definitions should I learn?

This chapter has 5 definitions: Computational thinking, Recursion, Base case, Divide and conquer and Big-O notation.

Which formulas are in this chapter?

Recursive factorial: def fact(n): return 1 if n == 0 else n * fact(n - 1).

How do I practise this chapter?

Read the notes, then answer the chapter's questions without looking, and take the chapter test.

Are these notes free?

Yes. Every notes page, its questions with answers and its tests are free, with no account needed.

Notes written by Parho for the Punjab textbook. Spotted a mistake? Tell us.