Graph and Tree Traversal (AQA A-Level Computer Science): Flashcards

📚Flashcards
Graph and Tree Traversal
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

10 cards from this deck

Show

Traversal definition

Visiting every node in a structure in a specific order

Adjacency list

Each node listed with all nodes directly connected to it

Adjacency matrix

2D array with 1s (edge exists) and 0s (no edge)

Depth first traversal method

Explores far along each path before backtracking

Breadth first traversal method

Explores all nodes at current distance before moving further

Binary tree definition

Tree where each node has at most two children

Pre-order traversal sequence

Visit, left, right

In-order traversal sequence

Left, visit, right

Post-order traversal sequence

Left, right, visit

Recursion base case

Defines when recursive function stops calling itself

Join 100,000+ A-Level students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.