Essential algorithms for GCSE and A Level Computer Science

Higher order data structures

Supported by some programming languages within the command set, programmers often implement these structures using the fundamental data structures as building blocks.

What is a graph?

A graph is a data structure consisting of nodes (vertices) and pointers (edges).  It differs from a linked list and binary tree because each vertex can have more than one or two edges and point to any vertex in the data structure.  The edges can either point in one direction, known as a directed graph, or without specifying a direction (bidirectional), referred to as an undirected graph. 

Graphs can also be weighted, with each edge given a value representing a relationship such as distance between the vertices. 

Although it is common to refer to vertices and edges when discussing graphs, this is largely due to their application in mathematics.  A vertex can also be referred to as a node and an edge as a pointer.

Graph videos

What extra is in the book?

This algorithm / data structure has its own dedicated chapter in the book, which includes:

  1. Overview
  2. Typical applications / uses
  3. Typical operations
  4. The algorithm written out in simple-structured English
  5. The algorithm written out in pseudocode
  6. Full code listing Python
  7. Full code listing in Visual Basic
  8. Diagrammatic walk-through
  9. Efficiency discussion with reference to Big-O notation

A hard copy of the book is available on our shop and a free PDF copy is included for all premium subscribers.