Skip to content
UoL CS Notes

Home

This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.

Bipartite Graphs

COMP202 Lectures

A bipartite graph is a graph whose vertex stet can be partitioned into two sets $X$ and $Y$, such that every edge joins a vertex in $X$ to a vertex in $Y$: graph LR x1 ------ y1 & y2 x2 ------ y1 & y3 & y2 x3 ------ y2 x4...

Read More

C# Design Patterns (MVC, Factory & Decorator)

COMP282 Lectures

Model-View-Controller This is a design pattern that splits a user interface into three parts: Model - The internal state and data of the application. View - The GUI elements and how they appear to the user. Controller - Create events that modify the internal state of the application. MVC Advantages...

Read More

Refactoring

COMP285 Lectures

Refactoring is where we improve our code quality while maintaining the same functionality. This yields better: Readability Testing OO Structure Re-usability Efficiency Extend-ability Code Smell These are issues with the code that aren’t bugs. They are bad coding practices: Duplicated Code We should use generalised classes that we can extend...

Read More

Introduction to C#

COMP282 Lectures

C# is a fully managed language (like Java). Memory is garbage collected and the compiler handles the allocation of resources automatically. Hello, world! A hello world program would look something like so: using System; class Hello { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } Getters & Setters in...

Read More

Graphs

COMP202 Lectures

For the definition of a graph see the lectures: COMP108 - Graphs - 1 An undirected graph $G$ is simple if there is at most one edge between each pair of vertices $u$ and $v$. A digraph is simple if there is at most one directed edge from $u$ to...

Read More

Event-Driven Programs

COMP284 Lectures

Our programs can react to events on the client side by writing event handlers. There is an example of creating noughts and crosses starting from slide 13 of the lecture. This is hosted live at: https://cgi.csc.liv.ac.uk/~ullrich/COMP284/examples/jsBoard.html. Events Event handlers are associated with HTML elements for a specific event. We can...

Read More

Standard Template Library - Algorithms

COMP282 Lectures

There are the following types of algorithms: Min/Max: min_element, max_element Sorting: sort, stable_sort Non-modifying Sequence: all_of, any_of, none_of, find_if, count_if Modifying Sequence: copy, shuffle, unique, reverse Misc Helper functions for searches, sorts and tree structures. min We can write our own simple algorithm like so: #include <vector> #include <algorithm> #include...

Read More

Standard Template Library - Containers & Iterators

COMP282 Lectures

Standard Template Library Each template consists of three main parts: Containers - Standard data structures. Iterators - Standard ways to move through the standard data structures. Algorithms - Use iterators to complete a task with data. Containers An example of a container is a vector this is how you would...

Read More

Dynamic Web Pages Using JavaScript

COMP284 Lectures

Window Object A window object represents an open window in a browser. If a document contains frames, there there is: One window object, for the HTML document. One additional window object for each frame accessible via a window.frames array. Whenever an object or property is referenced in a script without...

Read More