Computer Science Chapter Notes
Class 12 Computer Science · 13 of 13 chapters with notes
Chapter 1 · Exception Handling in Python
- Syntax errors are detected before execution; exceptions occur at runtime.
try/except/else/finallyblocks handle exceptions gracefully.- Custom exceptions can be raised using
raise.
Chapter 2 · File Handling in Python
- Text files store readable characters; binary files store data in internal program format.
- File modes:
"r"read,"w"write (overwrite),"a"append,"rb"/"wb"for binary. - The
picklemodule serialises/deserialises Python objects to/from binary files.
Chapter 3 · Stack
- Stack follows LIFO (Last In, First Out); operations: push (insert), pop (remove from top).
- Used for infix-to-postfix conversion and evaluating postfix expressions.
Chapter 4 · Queue
- Queue follows FIFO (First In, First Out); operations: enqueue (insert at rear), dequeue (remove from front).
- A deque allows insertion/deletion from both ends.
Chapter 5 · Sorting
- Bubble sort: repeatedly swaps adjacent out-of-order elements; $O(n^2)$.
- Selection sort: repeatedly selects the minimum and places it correctly; $O(n^2)$.
- Insertion sort: builds the sorted list one element at a time; best case $O(n)$ for nearly-sorted data.
Chapter 6 · Searching
- Linear search: checks each element sequentially; $O(n)$.
- Binary search: repeatedly halves the search range on sorted data; $O(\log n)$.
- Hashing: uses a hash function to map keys directly to array positions for near-instant lookup.
Chapter 7 · Understanding Data
- Data can be qualitative (categorical) or quantitative (numeric).
- Data sources: primary (firsthand) or secondary (reused, published).
- Data processing converts raw data into meaningful information via statistical techniques.
Chapter 8 · Database Concepts
- DBMS manages data efficiently, ensuring integrity and reducing redundancy compared to a file system.
- Relational model organises data into tables (relations) with rows (tuples) and columns (attributes).
- Keys: candidate key, primary key, foreign key — used to identify records and establish relationships.
Chapter 9 · Structured Query Language (SQL)
- DDL commands (
CREATE,ALTER,DROP) define database structure. - DML commands (
INSERT,UPDATE,DELETE) manipulate data. SELECTwithWHERE,GROUP BY, and aggregate functions (SUM,COUNT,AVG) query and summarise data.
- DDL commands (
Chapter 10 · Computer Networks
- Network types by scale: LAN, MAN, WAN.
- Topologies: star, bus, ring, mesh — describe the physical/logical arrangement of network devices.
- The Internet is a global network of networks; the Web (WWW) is a system of interlinked documents accessed via the Internet.
Chapter 11 · Data Communication
- Modes: simplex (one-way), half-duplex (both ways, one at a time), full-duplex (both ways simultaneously).
- Transmission media: wired (twisted pair, coaxial, fibre optic) and wireless (radio, microwave, satellite).
- Protocols (like TCP/IP) define rules for reliable data exchange between devices.
Chapter 12 · Security Aspects
- Malware types: virus, worm, trojan horse, spyware.
- HTTPS encrypts data in transit (unlike plain HTTP), protecting sensitive information.
- Firewalls monitor and control incoming/outgoing network traffic based on security rules.
Chapter 13 · Project Based Learning
- Project workflow: define requirements → design database/logic → implement → test → document.
- Teamwork divides responsibilities and enables peer review, mirroring real-world software development practices.