• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 3 pages
Summary

Summary Data Structures and Algorithms: Complexity, Trees, Hashing and Graphs

Document preview thumbnail
Preview 1 out of 3 pages

Three pages of data structures and algorithms notes organised around the operations exam questions actually ask you to cost. Section 1 covers asymptotic notation, amortised analysis and what big O hides, with the standard sorting results and their justifications. Section 2 covers arrays, linked lists, stacks, queues and deques as trade-offs in operation mix. Section 3 covers tree traversals, binary search trees, AVL and red-black balancing, and heaps including build-heap in O(n). Section 4 covers hashing (collisions, load factor, resizing) and graphs (representations, BFS, DFS, Dijkstra, Bellman-Ford, topological order). A six-by-five table gives the cost of each operation across the main structures, which is the comparison most papers ask for. Includes four practice questions with marking checkpoints, an eight-term glossary, and a 40-minute revision plan. 3 pages, A4, PDF, print-ready.

Content preview

Data Structures and Algorithms: Complexity, Trees,
Hashing and Graphs
Operation costs, invariants and worked traces for a first course in algorithms
Computer Science | Undergraduate (Level 5) | December 2026


WHAT IS INSIDE

1. Measuring cost: asymptotics and what they hide
2. Linear structures: arrays, lists, stacks and queues
3. Trees: traversal, search trees and heaps
4. Hashing and graphs
Exam question patterns
Glossary of exam-ready definitions

1. Measuring cost: asymptotics and what they hide
Big O describes an upper bound on growth, Omega a lower bound and Theta a tight bound. The
standard orderings - O(1), O(log n), O(n), O(n log n), O(n squared), O(2 to the n) - are the vocabulary
the exam expects, and each must be attached to a specific operation rather than to a data structure as a
whole: a hash table gives O(1) average lookup and O(n) worst case, and saying only 'O(1)' is
incomplete.
Asymptotics hide constants, memory layout and cache behaviour, which is why an array can beat a
linked list in practice even where the asymptotic costs are equal. Amortised analysis is a separate idea:
appending to a dynamic array is O(1) amortised although individual appends can be O(n), and
doubling capacity is what produces that result. Recurrence relations for divide-and-conquer algorithms
are solved by the master theorem, and the standard results - merge sort and heap sort at O(n log n),
quicksort at O(n log n) average and O(n squared) worst - should be known with their justification.
• Space complexity - count auxiliary space, not the input; in-place algorithms are O(1) auxiliary.
• Stability - a stable sort preserves the relative order of equal keys; merge sort is stable, heap sort and
quicksort are not.
• Comparison lower bound - comparison sorts cannot beat Omega(n log n), which is why counting
and radix sort trade space for time.
• Adversarial inputs - a hash table degenerates to O(n) if every key collides, which is why randomised
hashing exists.

2. Linear structures: arrays, lists, stacks and queues
An array gives O(1) random access and O(n) insertion or deletion in the middle, because elements after
the position must shift. A linked list reverses that trade: O(1) insertion at a known node, but O(n)
search and poor locality. Doubly linked lists add O(1) deletion given a node, at the cost of an extra
pointer per element; circular lists remove the need to test for the end.
A stack is last-in-first-out and underpins function calls, expression evaluation and depth-first search; a
queue is first-in-first-out and underpins breadth-first search and scheduling. A deque supports both
ends in O(1), and a priority queue - implemented as a binary heap - supports insert and extract-min in
O(log n). Choosing between them is a question about which operations are frequent, so state the


Data Structures and Algorithms: Complexity, Trees, Hashing a Page 1 of 3

Document information

Study
Unknown
Uploaded on
December 1, 2026
Number of pages
3
Written in
2026/2027
Type
Summary
$7.98

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
225
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions