### Computer Science 101: change some words
#### 1. What is Computer Science?
- **Definition:** The study of computers and computational systems.
Unlike electrical engineering, CS deals mostly with software and
software systems—how they're designed, built, and theoretically
understood.
- **Core Question:** "What can be automated?" and "What can be
computed?"
- **Main Areas:** Programming, algorithms, data structures, systems,
theory, AI, human-computer interaction.
---
#### 2. Core Concepts
| **Term** | **Definition** |
| :--- | :--- |
| **Algorithm** | Step-by-step procedure for solving a problem (like
a recipe). |
| **Program** | Algorithm written in a language a computer can
execute. |
| **Code** | Instructions written by programmers (source code) →
compiled/interpreted to machine code (1s and 0s). |
| **Data** | Information processed/stored by computer. |
| **Abstraction** | Hiding complexity behind simple interfaces (you
drive car without understanding engine). |
| **Computational Thinking** | Problem-solving approach using CS
concepts: decomposition, pattern recognition, abstraction, algorithm
design. |
---
#### 3. Programming Basics
- **Variables:** Containers storing data values (x = 5).
- **Data Types:**
- **Integer:** Whole numbers (5, -3, 42).
- **Float:** Decimal numbers (3.14, 2.5).
- **String:** Text ("hello", "CS101").
- **Boolean:** True/False.
- **Array/List:** Collection of items [1,2,3].
- **Control Structures:**
- **Conditionals:** If/else statements (if x > 0: print "positive").
- **Loops:** Repeat code (for i in range(10):, while x < 10:).
- **Functions:** Reusable blocks of code (def add(a,b): return
a+b).
- **Syntax vs. Semantics:** Syntax = grammar rules; Semantics =
meaning.
- **Paradigms:**
- **Imperative:** Step-by-step commands.
- **Object-Oriented (OOP):** Organize code around objects
(contains data + methods). Class = blueprint, Object = instance.
- **Functional:** Based on mathematical functions, avoids
changing state.
---
#### 4. Data Structures (Ways to Organize Data)
| **Structure** | **Description** | **Use Case** |
| :--- | :--- | :--- |
| **Array** | Fixed-size, sequential, same type elements. Fast access
by index. | Lists where size known. |
| **Linked List** | Elements (nodes) point to next. Dynamic size,
easy insert/deletion. | When frequent insertions/deletions. |
| **Stack** | LIFO (Last In, First Out). Push (add), Pop (remove). |
Undo functions, browser back button. |
| **Queue** | FIFO (First In, First Out). Enqueue (add), Dequeue
(remove). | Print spooling, task scheduling. |
| **Hash Table (Map/Dictionary)** | Key-value pairs. Fast lookup. |
Databases, caches, dictionaries. |
| **Tree** | Hierarchical structure (root, branches, leaves). Binary tree
= each node has ≤2 children. | File systems, HTML DOM, decision
trees. |
| **Graph** | Nodes + edges (connections). Can be directed/undirected,
weighted/unweighted. | Social networks, maps, web pages. |
---
#### 5. Algorithms (Problem-Solving Recipes)
- **Sorting Algorithms:**
- **Bubble Sort:** Swap adjacent if out of order—slow but
simple.
- **Merge Sort:** Divide, sort recursively, merge—fast O(n log
n).
- **Quick Sort:** Partition around pivot—fast average case.
- **Searching Algorithms:**
- **Linear Search:** Check each item—slow but works on
unsorted.
- **Binary Search:** Divide sorted list in half repeatedly—very
fast O(log n).
- **Big O Notation:** Describes algorithm efficiency (how runtime
grows with input size).
- O(1): Constant time (best).
- O(log n): Logarithmic (binary search).
- O(n): Linear (simple loop).
- O(n²): Quadratic (nested loops—slow).
- O(2ⁿ): Exponential (very slow—avoid).
- **Recursion:** Function calls itself (factorial, Fibonacci). Needs base
case to stop.
---
#### 6. Computer Systems & Architecture
- **Hardware Layers:**
- **CPU (Central Processing Unit):** Brain of computer.
Fetches/decodes/executes instructions.
- Cores = independent processing units.
- Clock speed = cycles per second (GHz).
- **Memory (RAM):** Temporary, fast storage (volatile—lost
when power off).
- **Storage:** Permanent (SSD, HDD). Slower but non-volatile.
- **Input/Output:** Keyboard, mouse, monitor, network.
- **Binary & Bits:**
- Computers use binary (1s and 0s). Bit = binary digit (0 or
1). Byte = 8 bits.
- ASCII: Maps characters to numbers (A = 65).
- **Operating System (OS):** Manages hardware/software (Windows,
macOS, Linux, Android, iOS). Handles memory, processes, files,
devices.
- **Von Neumann Architecture:** Stored-program concept (instructions
+ data in same memory).
---
#### 7. Software Engineering Basics
- **SDLC (Software Development Life Cycle):** Planning → Analysis
→ Design → Implementation → Testing → Deployment → Maintenance.
- **Methodologies:**
- **Waterfall:** Sequential phases (rigid, old-school).
- **Agile:** Iterative, flexible, incremental (Scrum,
Kanban—modern standard).
- **Version Control:** Tracks code changes (Git, GitHub).
- **Testing:**
- **Unit Testing:** Test individual components.
- **Integration Testing:** Test combined components.
- **Debugging:** Finding/fixing bugs.
---
#### 8. Key Areas of CS
| **Field** | **What It Is** | **Examples** |
| :--- | :--- | :--- |
| **Artificial Intelligence (AI)** | Machines mimicking human
intelligence. | Game AI, expert systems |
| **Machine Learning (ML)** | Algorithms that learn from data. |
Recommendations, spam filters |
| **Databases** | Organized data storage/retrieval. SQL (structured
query language). | MySQL, PostgreSQL, MongoDB |
| **Networks** | Computers connected to communicate. TCP/IP, HTTP,
DNS. | Internet, LAN, Wi-Fi |
| **Cybersecurity** | Protecting systems/networks/data. | Encryption,
firewalls, authentication |
| **Human-Computer Interaction (HCI)** | Designing interfaces for
humans. | UI/UX design, usability |
| **Theory of Computation** | What can/cannot be computed. |
Turing machines, P vs NP |
---
#### 9. Internet & Web Basics
- **How It Works:** Client (your browser) requests → Server (hosts
website) responds.
- **Key Protocols:**
- **HTTP/HTTPS:** Web communication (S = secure/encrypted).
- **TCP/IP:** Rules for sending data packets across networks.
- **DNS (Domain Name System):** Translates [Link] → IP
address.
- **Frontend vs. Backend:**
- **Frontend:** What user sees (HTML/CSS/JavaScript).
- **Backend:** Server-side logic/databases (Python, Java, PHP,
Ruby, [Link]).
- **APIs (Application Programming Interfaces):** Allow different
software to talk to each other (weather app getting data from
weather service).
---
#### 10. Essential Concepts to Remember
| **Concept** | **Simple Explanation** |
| :--- | :--- |
| **Moore's Law** | Computing power doubles every ~2 years
(slowing now). |
| **Open Source** | Software with source code anyone can
use/modify/share (Linux, Firefox). |
| **Cloud Computing** | Using remote servers (internet) instead of
local machine (AWS, Google Cloud). |
| **Encryption** | Scrambling data so only authorized can read
(HTTPS, WhatsApp). |
| **Compiled vs. Interpreted** | Compiled: Code→machine code before
running (C++, faster). Interpreted: Code read line-by-line (Python,
more flexible). |
| **Pseudocode** | Plain language description of algorithm (not actual
code). |