Bipartite Graphs
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...
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.
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...
A flow network $G=(V,E)$ is a directed graph in which each edge $(u,v)\in E$ has a non-negative integer capacity $c(u,v)\geq 0$. In a flow network there are two main vertices: Source: $s$ Sink $t$ We assume that $s$ has no “in-edges” and that $t$ has no “out-edges”. Each edge $(u,v)$...
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...
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...
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...
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...
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...
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...
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...
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...