Tamil Nadu HSE Second Year Computer Science study materials
Tamil Nadu HSE Second Year Computer Science study resources

Tamil Nadu HSE Second Year Computer Science: Problem Solving, Algorithms and Ethics in Computing

Tamil Nadu HSE Second Year Computer Science · Work through your exam, one topic at a time.

All guide sections

Problem Solving, Algorithms and Ethics in Computing

What this domain tests

How a problem becomes a precise, finite sequence of steps, how that algorithm is represented, how common algorithms behave, and the ethical and legal responsibilities of a computer user.

Core rules

  • An algorithm has definiteness, finiteness, input, output and effectiveness. A program is an implementation; pseudocode is language-neutral.
  • Flowchart symbols: oval for start/stop, parallelogram for input/output, rectangle for process, diamond for decision, arrows for flow.
  • Linear search scans sequentially, O(n), and works on unsorted data. Binary search repeatedly halves a sorted array, O(log n), and needs sorted order.
  • Bubble sort compares adjacent pairs and swaps; after pass k the largest k elements are in place. Selection sort repeatedly selects the minimum. Insertion sort builds a sorted prefix.
  • Ethics: do not access systems without authorisation, do not plagiarise code, protect personal data, respect software licences and intellectual property, and report vulnerabilities responsibly. Cyber law in India includes the IT Act, 2000.

Worked example

Search 7 in [2, 5, 7, 10, 13] using binary search. low=0, high=4, mid=2, and the element at index 2 is 7, so it is found in one comparison. For target 10: mid=2 gives 7 < 10, so low=3; mid=3 gives 10, found. The array must be sorted first.

Traps that cost marks

Applying binary search to unsorted data; counting comparisons incorrectly; confusing an algorithm with a flowchart; writing a loop with no terminating condition; treating copying a classmate's program as acceptable collaboration; mixing up the passes of bubble sort.