Computer Science Notes


What is this site about?

This is a set of notes and study materials about Computer Science.

The links are to pdfs

How to contact me

Please send comments, questions and corrections to


Maths-related web pages

Vector and scalar fields in 2D

Including div grad and curl in 2D

2D vectors and scalars

A web page about vectors and scalars in 2D - addition, dot product, matrix transforms and so on.

3D Graphs

A web page which draws 3D graphs


A web page which draws graphs of single variables


A web page which handles sequences.

Maths in Python

Three related items about maths in Python:

Mython Notes

Some notes about the Python source code and an outline of the maths it relates to - sets, ordered pairs, relations, functions, natural numbers, integers, rational numbers, and binary operations.

The Python source code

The Python source code

Documentation of

Do not blame me for this - blame pydoc.

Starting Programming

In html, CSS, JavaScript, C and Python


An introduction to html - how to write web pages. No special software needed. Elements, tags, attributes, headings, paragraphs, images, links, semantic elements. Also http


CSS - adding style to web pages. Colours, fonts, borders, margins, layout and more. Learn html first.


A first programming language, used in almost all web pages. Still no special software needed.

Programming Fundamentals

The theory behind the ideas in all programming languages, common to C, Java, JavaScript, Python, assembler and all the rest.


A few notes and examples about basic debugging techniques


Programming in C. The language Unix was written in, and Linux, the basis of C++ and Java and JavaScript, number 1 or 2 in Tiobe's language ratings since 2001.


An introduction to Python. The language, built-in functions and classes, writing classes.


An introduction to Java. In Tiobe's top 3 languages over the last 20 years. Procedural programming, using some standard classes, and writing classes.


Some notes on SVG - Scalable Vector Graphics, in html5 and JavaScript

Data structures and algorithms


The theory, applicable to all languages. Pseudo-code, Time and Space Complexity, Linear search, Binary search of a list, Binary tree search, Bubble sort, Merge sort, Tree traversals - in-order, Pre-order, Post-order, Infix and reverse Polish, Graph traversals – breadth-first

Data Structures

For all languages. Key-value pairs, Memory and file storage, Fields, records and files, Abstract data types, Arrays, Queues, Stacks, Graphs, Trees, Hash tables, Maps

Data Structures and Algorithms in C and Java

Practical implementations in C and Java

Data Structures and Algorithms in Python

Data Structures and Algorithms in Python


FSM theory

Some notes about finite state machines.

FSM sim

A FSM simulation.

OPP theory

Some notes about operator precedence parsers.


An operator precedence parser.

Turing machines

A Turing machine simulation, with notes and example.

Maths foundations

Logic, sets, functions, numbers, polynomials, logarithms, vectors.

Digital Logic

Combinational logic Truth tables The basic gates truth tables Boolean algebra notation, Logic circuit from Boolean algebra, Boolean expression from circuit Half adder Full adder, Decoder Boolean algebra identities de Morgan's Laws Karnaugh Maps Sequential logic, S R and J K flip-flop, Clocks, D type latch

Data Representations

Two-state devices, Number bases, Analog and digital, Numbers, Unsigned integers, Signed two's complement,Fixed point, Floating point, Absolute and relative errors, Range and precision, Normalisation, Underflow and overflow, Characters and strings, Digits as characters, Images and sound, Bitmapped graphics, Digital sound, Sampling rates and Nyquist's Theorem, MIDI, Data errors compression and encryption, Run-length encoding, Dictionary compression, Encryption

Data representations in Java

Binary, hex, octal, ints and doubles and chars

Device Architecture

The stored program concept, Harvard and von Neumann architectures, Storage, Processors and memory, Instruction execution, Machine code, assembler, Opcodes and operands, Common instruction types, Addressing mode, Instruction formats, Optimisations, Cache memory, Pipelining, Multiple cores,Clock speed, Word length and data bus, Instruction length, Address bus width

Networks and communications

Communications and networks

Serial, parallel, simplex, duplex, bit rate and baud rate, bandwidth and latency, LANs and Wans and the Internet, routers hubs switches gateways routers, protocol models, TCP, IP, packets, NAT

TCP on Linux with Wireshark

A few notes about the practicalities of LANs and the Internet on Linux, and some material on socket programming.


Databases and SQL

Flat files, Relational databases, Database servers, Database systems architecture Normalisation, Users, groups and permissions, Views, Schema and data dictionary Advantages of database use, SQL, Creating the database and tables, Inserting new rows, Basic queries, Queries using WHERE, LIKE, GROUP BY, DROP, ORDER BY, UPDATE, JOIN, DELETE rows, Nested queries, Referential integrity, DDL and DML Transactions and ACID, Commit and roll-back, Concurrency and record-locking

Low level code

Assembler simulation

An online simulation of assembler, native code and the fetch-execute cycle.


Assembly language programming on an x86 architecture on Linux. Detailed - 60+ pages


Bytecode compiled from Java