Docsity

Computer Science Complete Study Notes and Exam Preparation Guide, Summaries of Computer science

Toggle sidebar
bg1
COMPUTER SCIENCE
COMPLETE STUDY GUIDE
Foundations, Programming, Databases, Networks, Security & Practice
Designed for
Beginning university and college learners
Includes
Clear explanations • worked examples • review questions • answer key
Edition
Independent learning edition • 2026
Original educational material prepared as a general-purpose study resource. It is not affiliated with any university, board, or certification
body.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download Computer Science Complete Study Notes and Exam Preparation Guide and more Summaries Computer science in PDF only on Docsity!

COMPUTER SCIENCE

COMPLETE STUDY GUIDE

Foundations, Programming, Databases, Networks, Security & Practice

Designed for Beginning university and college learners

Includes Clear explanations • worked examples • review questions • answer key

Edition Independent learning edition • 2026

Original educational material prepared as a general-purpose study resource. It is not affiliated with any university, board, or certification body.

How to Use This Guide

This guide introduces core computer science ideas in a practical order. Read each chapter, rewrite key definitions in your own words, attempt the practice questions without looking at the answers, and then review the answer key.

  • For first-time learners: study Chapters 1–4 before moving to databases, networks, and security.
  • For revision: use the chapter summaries and the final practice set to identify weak areas.
  • For assignments: use this guide to understand concepts, then write your own response and cite any additional sources your course requires.

Study tip: This is a general introductory guide. Course syllabi differ, so compare it with your teacher's outline before relying on it for a specific exam.

Contents

Chapter 1. Introduction to Computer Science

Chapter 2. Computer Systems and Data Representation

Chapter 3. Algorithms, Logic and Problem Solving

Chapter 4. Programming Fundamentals with Python

Chapter 5. Data Structures and Complexity

Chapter 6. Databases and SQL

Chapter 7. Computer Networks and the Internet

Chapter 8. Operating Systems and Software Engineering

Chapter 9. Cybersecurity, Privacy and Responsible Computing

Chapter 10. Artificial Intelligence and Data Literacy

Chapter 11. Revision Sheets and Glossary

Chapter 12. Practice Examination and Answer Key

CHAPTER 1

Introduction to Computer Science

Computer science studies computation: how information is represented, processed, stored, communicated, and used to solve problems.

1.1 What is a computer?

A computer is an electronic system that accepts input, processes data according to instructions, stores information, and produces output. A computer system includes hardware, software, data, users, and procedures.

Term Meaning Example

Hardware Physical components you can touch Keyboard, processor, SSD

Software Programs and instructions Web browser, operating system

Data Raw facts represented in a form a computer can process

Numbers, text, images

Input Information supplied to a system Typing a message

Processing Operations performed on input data Calculating a total

Output Results produced by the system A displayed total

Storage Keeping data for later use Saving a document

1.2 Major areas of computer science

  • Programming: designing instructions that a computer can execute.
  • Algorithms: defining a finite sequence of steps to solve a problem.
  • Data structures: organizing data so it can be used efficiently.
  • Databases: storing, retrieving, and managing structured information.
  • Networks: connecting devices to exchange data.
  • Cybersecurity: protecting systems, data, and users from misuse.
  • Artificial intelligence: building systems that perform tasks associated with abilities such as prediction, language processing, or perception.

1.3 Types of computers and systems

Personal computers are general-purpose devices for individual users. Servers provide services to other devices. Embedded systems control functions inside products such as vehicles and appliances. Mobile devices prioritize portability. High-performance computers are designed for demanding scientific or engineering workloads.

1.4 Information systems and users

A useful system is not just technically correct; it must also fit user needs. Accessibility, reliability, usability, privacy, cost, and maintainability are important design concerns. For example, a school attendance system should protect student records and remain usable by authorized staff.

Chapter summary

  • Computer science concerns information, computation, and problem solving.
  • Hardware carries out physical operations; software provides instructions.
  • A computer system combines technology, data, people, and procedures.

Practice questions

    1. Define computer science in your own words.
    1. Differentiate hardware and software, giving two examples of each.
    1. Explain the input–process–output cycle using a real-life example.
    1. Name four areas of computer science and describe one application of each.

2.5 Units and file size

  • 1 byte = 8 bits.
  • A kilobyte (KB) is often used as 1,000 bytes; a kibibyte (KiB) is 1,024 bytes.
  • Compression reduces file size. Lossless compression preserves all original information; lossy compression discards some information to reduce size.

Chapter summary

  • The CPU processes instructions; RAM is temporary; drives provide persistent storage.
  • Binary represents values using powers of two.
  • Text, pictures, and audio require encoding into digital data.

Practice questions

    1. What is the difference between RAM and an SSD?
    1. Convert binary 1010 to decimal.
    1. Convert decimal 9 to binary.
    1. Explain the difference between lossless and lossy compression.
    1. Why does a higher-resolution image often require more storage?

CHAPTER 3

Algorithms, Logic and Problem Solving

An algorithm is a clear, finite method for producing a result or solving a class of problems.

3.1 Characteristics of a good algorithm

  • Input: accepts zero or more well-defined inputs.
  • Output: produces at least one result.
  • Definiteness: each step is clear.
  • Finiteness: it eventually stops.
  • Effectiveness: steps can actually be carried out.

3.2 Problem-solving workflow

A practical workflow is: understand the problem, identify inputs and outputs, break the task into smaller steps, design an algorithm, test it with normal and edge cases, implement it, and improve it after evaluation.

3.3 Pseudocode and flowcharts

Pseudocode describes logic in structured plain language without requiring exact programming syntax. Flowcharts use standard shapes to show actions and decisions. Both help communicate a solution before implementation.

START\nINPUT mark\nIF mark >= 50 THEN\n DISPLAY "Pass"\nELSE\n DISPLAY "Needs improve ment"\nEND IF\nSTOP

3.4 Conditions and Boolean logic

A Boolean value is either True or False. Comparisons such as x > 5 produce Boolean results. AND is true only when both conditions are true; OR is true when at least one condition is true; NOT reverses a Boolean value.

A B A AND B A OR B

False False False False

False True False True

True False False True

True True True True

3.5 Testing and debugging

Testing checks whether software behaves as intended. Debugging finds and fixes causes of incorrect behavior. Test normal inputs, boundary values, invalid inputs, and unexpected situations. For example, a program that accepts ages should be tested with a typical age, zero, a negative number, and non-numeric text if those inputs are possible.

3.6 Example: find the larger of two numbers

INPUT a, b\nIF a > b THEN\n DISPLAY a\nELSE IF b > a THEN\n DISPLAY b\nELSE\n DISP LAY "Both are equal"\nEND IF

CHAPTER 4

Programming Fundamentals with Python

Programming languages let people express algorithms in a form that can be translated or interpreted for execution.

4.1 Variables and data types

A variable is a named reference to a value. Common introductory Python types include int (whole numbers), float (numbers with a fractional part), str (text), and bool (True or False). Choose meaningful variable names and keep values in an appropriate type.

student_name = "Amina"\nage = 19\nscore = 87.5\nis_enrolled = True

4.2 Input, output and conversion

name = input("Enter your name: ")\nscore_text = input("Enter score: ")\nscore = float(score _text)\nprint("Hello", name)\nprint("Score:", score)

The input() function returns text, so convert it when numeric calculation is required. Conversion can fail if the text is not a valid number; robust programs validate user input.

4.3 Operators

Category Examples Purpose

Arithmetic + - * / // % ** Calculations

Comparison == != < <= > >= Compare values

Logical and, or, not Combine conditions

Assignment =, +=, -=, *= Store or update values

4.4 Selection: if / elif / else

temperature = 31\nif temperature >= 35:\n print("Very hot")\nelif temperature >= 25:\n print("Warm")\nelse:\n print("Cool")

Python uses indentation to mark code blocks. Conditions are checked in order; the first matching branch is executed.

4.5 Iteration: loops

for number in range(1, 6):\n print(number)\n\ncount = 3\nwhile count > 0:\n print(cou nt)\n count -= 1

A for loop is useful when iterating over a sequence or known range. A while loop repeats while a condition remains true. Always ensure a while loop can eventually stop.

4.6 Functions

def area_rectangle(width, height):\n return width * height\n\narea = area_rectangle(4, 6 )\nprint(area) # 24

Functions group reusable logic. Parameters receive inputs; return sends a result back to the caller. Small functions with clear names are easier to test and maintain.

4.7 Lists and dictionaries

subjects = ["Programming", "Databases", "Networks"]\nprint(subjects[0])\nsubjects.append("S ecurity")\n\nstudent = {"name": "Amina", "semester": 3}\nprint(student["name"])

Lists store ordered collections and use zero-based indexing. Dictionaries map keys to values. Use a list when sequence matters; use a dictionary when values are naturally looked up by key.

4.8 Common errors

  • Syntax error: code violates language grammar, such as a missing colon.
  • Runtime error: a problem occurs during execution, such as division by zero.
  • Logic error: the program runs but produces the wrong result.

4.9 Worked example: pass or fail

mark = float(input("Enter mark (0-100): "))\nif mark < 0 or mark > 100:\n print("Invalid mark")\nelif mark >= 50:\n print("Pass")\nelse:\n print("Fail")

This example validates the range before checking the pass threshold. In a real assessment system, the pass mark and grading rules must match the relevant institution's policy.

Chapter summary

  • Variables hold values; types determine how values behave.
  • Conditions select a path; loops repeat instructions; functions promote reuse.
  • Lists store ordered items, while dictionaries map keys to values.

Practice questions

    1. What data type is returned by input()?
    1. Write a function that returns the square of a number.
    1. Explain one difference between a for loop and a while loop.
    1. What is the difference between a syntax error and a logic error?
    1. Write a program that prints all even numbers from 2 to 10.

Notation Common interpretation Example

O(log n) Logarithmic growth Binary search

O(n) Linear growth Scan every item

O(n log n) Linearithmic growth Efficient comparison sorting

O(n²) Quadratic growth Simple nested-loop comparisons

Study tip: Do not assume an algorithm is always fast just because it works on a small example. Consider how time and memory change when the input becomes much larger.

Chapter summary

  • Choose a data structure based on the operations your program needs.
  • Stacks use LIFO; queues use FIFO.
  • Binary search needs sorted input; Big-O describes growth, not exact seconds.

Practice questions

    1. Compare a stack with a queue.
    1. Why must binary search use sorted data?
    1. Which grows faster for large n: O(n) or O(n²)?
    1. Give one suitable real-world use for a graph.
    1. Explain what O(1) means in algorithm analysis.

CHAPTER 6

Databases and SQL

A database stores related information in an organized way so it can be searched, updated, and managed reliably.

6.1 Relational database concepts

A relational database organizes data into tables. A row (record) describes one entity or event; a column (field) describes one attribute. A primary key uniquely identifies each row. A foreign key refers to a key in another table and helps represent relationships.

StudentID StudentName Program

1001 Amina Computer Science

1002 Bilal Information Technology

6.2 Why use a database?

  • Reduce unnecessary duplication through thoughtful design.
  • Support controlled access and concurrent users.
  • Maintain consistency using constraints and transactions.
  • Query information without manually searching every record.

6.3 Basic SQL

SQL is widely used to define, retrieve, and change relational data. The following examples use a table named Students with columns StudentID, StudentName, and Program.

SELECT StudentName, Program\nFROM Students;

Retrieve only students in Computer Science:

SELECT StudentName\nFROM Students\nWHERE Program = 'Computer Science';

Sort by name:

SELECT StudentID, StudentName\nFROM Students\nORDER BY StudentName ASC;

Add a record (the column list and values must match the actual schema):

INSERT INTO Students (StudentID, StudentName, Program)\nVALUES (1003, 'Sara', 'Computer Sci ence');

6.4 Aggregation and grouping

SELECT Program, COUNT(*) AS StudentCount\nFROM Students\nGROUP BY Program;

COUNT counts rows or non-null values depending on the expression. GROUP BY forms groups for aggregate calculations. WHERE filters rows before grouping; HAVING filters groups after aggregation.

6.5 Relationships and normalization

One-to-one relationships connect one record to at most one other record. One-to-many relationships connect one record to multiple records. Many-to-many relationships usually require a junction table. Normalization is a set of design principles that reduces undesirable redundancy and update anomalies.

CHAPTER 7

Computer Networks and the Internet

A network connects devices so they can exchange data and share services.

7.1 Network types

  • PAN: a personal-area network around an individual, such as a short-range device connection.
  • LAN: a local-area network in a home, office, or campus.
  • WAN: a wide-area network spanning large geographic areas.

The Internet is a global network of interconnected networks. The World Wide Web is a service that operates over the Internet; it is not the same thing as the Internet itself.

7.2 Network devices

Device Main role

Router Forwards packets between networks

Switch Connects devices within a local network

Wireless access point Provides Wi-Fi connectivity to a network

Modem / terminal equipment Connects a local setup to an access technology, depending on the service

Firewall Applies rules to allow or block network traffic

7.3 IP addresses, DNS and URLs

An IP address identifies a network interface for communication. IPv4 addresses are 32 bits, usually written as four decimal octets. IPv6 uses 128-bit addresses. The Domain Name System (DNS) helps translate domain names such as example.com into records used to locate services.

A URL identifies a resource and commonly includes a scheme (such as https), a host name, and an optional path. HTTPS uses TLS to help protect data in transit between a client and server.

7.4 Packets and protocols

Network data is commonly divided into packets. Protocols define how systems format, send, route, and interpret data. TCP provides a reliable, ordered byte stream; UDP has lower overhead and does not guarantee delivery or ordering. IP handles addressing and routing packets across networks.

7.5 Client-server and peer-to-peer

In the client-server model, a client requests a service from a server. A browser requesting a webpage is a common example. In peer-to-peer systems, devices can act as both clients and providers of resources, depending on the design.

7.6 Network performance

Bandwidth is the capacity of a connection over time. Throughput is the actual achieved data rate. Latency is delay. Packet loss occurs when packets fail to reach their destination. A connection can have high bandwidth but still feel slow for interactive tasks if latency is high.

Chapter summary

  • LANs cover local areas; WANs span larger areas.
  • DNS maps domain names to records; HTTPS protects data in transit using TLS.
  • TCP prioritizes reliable ordered delivery; UDP does not provide those guarantees.

Practice questions

    1. Differentiate the Internet and the World Wide Web.
    1. What does DNS do?
    1. Compare TCP and UDP.
    1. Explain the role of a router and a switch.
    1. Define latency and throughput.

8.6 Version control and collaboration

Version control records changes to files over time. It helps teams review modifications, collaborate, create branches, and recover earlier versions. A commit should describe a coherent change. Before sharing a project, remove passwords, API keys, private data, and unnecessary generated files.

8.7 Software quality

  • Correctness: meets its stated requirements.
  • Reliability: works consistently under expected conditions.
  • Usability: users can operate it effectively.
  • Maintainability: developers can understand and change it safely.
  • Portability: it can be moved to another environment with manageable effort.

Chapter summary

  • An OS manages processes, memory, files, devices, and access.
  • Software development includes requirements, design, implementation, testing, deployment, and maintenance.
  • Version control and quality practices make collaborative work safer and more maintainable.

Practice questions

    1. Name five responsibilities of an operating system.
    1. Differentiate a process and a thread.
    1. List the main stages of a software development life cycle.
    1. Why is version control useful in a team project?
    1. Explain maintainability with an example.

CHAPTER 9

Cybersecurity, Privacy and Responsible

Computing

Cybersecurity reduces the risk of unauthorized access, disruption, theft, and damage. No single tool can eliminate every risk.

9.1 Core security goals

  • Confidentiality: information is accessible only to authorized parties.
  • Integrity: information remains accurate and protected from unauthorized changes.
  • Availability: systems and information are accessible when needed.

These three goals are often called the CIA triad. Security also includes authentication (proving identity), authorization (deciding permitted actions), accountability, and resilience.

9.2 Common threats

Threat Description Safer response

Phishing Messages imitate trusted sources to steal information

Verify sender and destination; avoid suspicious links

Malware Software designed to harm, spy, or gain unauthorized access

Use trusted sources, updates, and endpoint protection

Ransomware Malware that may encrypt data and demand payment

Maintain tested offline or protected backups

Password reuse One exposed password unlocks multiple accounts

Use unique passwords and a password manager

Social engineering Manipulation intended to bypass normal safeguards

Verify unusual requests through a separate channel

9.3 Practical account protection

  • Use long, unique passwords for important accounts.
  • Enable multifactor authentication when available.
  • Install operating-system and application security updates.
  • Keep backups and test that restoration works.
  • Limit app permissions and review account recovery settings.
  • Do not share verification codes or passwords with people who contact you unexpectedly.

9.4 Encryption and hashing

Encryption transforms readable data into ciphertext using a key, allowing authorized decryption. Hashing maps data to a fixed-size digest and is commonly used to check integrity. Passwords should be stored using purpose-built password-hashing algorithms with salts and suitable work factors, not as plain text or with a fast general-purpose hash alone.