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.

Linked Lists - 3 (Deletion)

COMP108 Lectures

Deletion from the Head of the List Consider a list 15, 10, 20. We want to remove 15 and return it to the user. List-Delete-Head(L) node = head if node =/= NIL then begin // list wasn't empty head = head.next if head =/= NIL then head.prev = NIL node.next...

Read More

Complex Valued Functions - 2 (Integral Calculus)

COMP116 Lectures

In real integration this can be likened to measuring the area under the graph. This is not true for complex numbers. Complex integration can be useful in finding the average case of an algorithm. Integrating Complex Numbers Suppose $f:\Bbb C\rightarrow \Bbb C$ and $p,q\in \Bbb C$. How do we interpret:...

Read More

Complex Valued Functions - 1 (Differential Calculus)

COMP116 Lectures

The main issue with complex numbers is that they cannot be ordered. These issues mainly effect the following class of functions: \[f:\Bbb C \rightarrow \Bbb C\] Functions with Real Domain & Complex Range The special case $f:\Bbb R\rightarrow \Bbb C$ is fairly straightforward since $f(x)$ is two rel valed functions:...

Read More

The Fourier Transform & Fast Arithmetic

COMP116 Lectures

The Fourier transform is an operation that maps between K$n$-vectors of complex values and $n$-vectors of complex values: \[F:C^n\leftrightarrow C^n\] The $\leftrightarrow$ indicates that this is a two-way process. This transformation is very useful for reducing noise and distortion in signal processing. It is also useful for a method of...

Read More

Linked Lists - 2 (Insertion)

COMP108 Lectures

Insertion Insertion to Head of List List-Insert-Head(L,node) node.next = head node.prev = NIL if head =/= NIL then head.prev = node else // list was empty tail = node head = node Insertion to Tail of List List-Insert-Tail(L,node) node.next = NIL node.prev = tail if tail =/= NIL then tail.next...

Read More

Linked Lists - 1 (Searching)

COMP108 Lectures

Linked lists are lists in which elements are arranges in a linear order. The order is determined by a pointer (rather than array indices). Structure Each node has a data field and one/two pointers linking to the next/previous element in the list. Nodes with one pointer are called singly linked...

Read More

Class Variables & Methods

COMP122 Lectures

Instance Variables Ordinarily, attribute values belong to individual objects and methods describe the object’s individual response to messages. An example is that two alarm clocks can each have their own type. Class Variables Using the keyword static you can declare that an attribute (or method) belongs to the class. This...

Read More

Encapsulation

COMP122 Lectures

Public and Private Content Attributes and methods can be public or private: private members of a class cannot be accessed from outside the object. public can be accessed from outside. This can be done via the dot notation: int t = alarmClock.time; alarmClock.setAlarm(t+5); The public members form the object’s interface....

Read More

Constructors

COMP122 Lectures

We recall that classes are templates for creating objects and we can instantiate an object by using the keyword new. Behind the scenes the following happen: The JVM allocates memory to store the new object. A constructor method is called to initialise it. Constructor Methods A constructor method is a...

Read More

Classes

COMP122 Lectures

There are two methods of creating objects: Copying and adjusting existing ones. Instantiating a template. Classes A class is a template of blueprint for objects: It specifies which attributes and methods should exist. An object can be an instance of the class. For example you may have many instances of...

Read More