Undo and redo for a text editor
Keep a history of edits so the last change can be undone and redone, with a limit on how much is remembered.
Practises
- Stacks
- Linked lists
- Complexity
Learn how the common data structures work inside, how to measure an algorithm’s time and memory, and how to choose the right approach for a new problem. Every structure is drawn and traced by hand, then written from scratch in the language your course uses, live and one-to-one.
Short answers to the questions students and parents ask first. Each one is explained in more detail further down the page.
A data structure is a way of organising data in memory, such as an array, a linked list, a hash table, a tree or a graph. An algorithm is a step-by-step method for solving a problem with that data, such as searching or sorting. Choosing the right pair is what makes a program fast.
University students on a DSA or algorithms course, students preparing for technical interviews or coding tests, and programmers who have finished OOP and want the next core subject.
Confident programming in C++, Java or Python, including loops, functions and arrays, and a basic understanding of classes and objects. School algebra is enough maths to begin.
Time and space complexity, arrays and linked lists, stacks and queues, recursion, searching and sorting, hashing, trees, graphs, and algorithm design with regular problem-solving practice.
Live and one-to-one on Microsoft Teams or Zoom, in C++, Java or Python. You trace each structure on a shared whiteboard, then write the code yourself while the tutor reviews it.
Book the free 30-minute introductory class with the form on this page or on WhatsApp. Tell us your course or the test you are preparing for; we reply within 24 hours.
The topics in the order they are usually taught. The tutor adjusts the order and depth to your level, and to your school or university syllabus if you share it.
The question at the heart of DSA. This table shows the usual cost of common operations in Big-O notation. In lessons you work each of these out yourself, rather than memorising the table.
| Structure or algorithm | Operation | Time | Note |
|---|---|---|---|
| Array | Read by index | O(1) | The position is calculated directly |
| Array | Search, unsorted | O(n) | May have to check every element |
| Dynamic array | Add at the end | O(1) amortised | An occasional resize copies every element |
| Linked list | Insert at the head | O(1) | Reaching position i first takes O(n) |
| Stack or queue | Push, pop, enqueue, dequeue | O(1) | Only the ends are touched |
| Hash table | Insert, look up | O(1) average | O(n) in the worst case, when many keys collide |
| Balanced binary search tree | Search, insert, delete | O(log n) | An unbalanced tree can degrade to O(n) |
| Binary heap | Insert, remove the minimum | O(log n) | Reading the minimum is O(1) |
| Binary search | Find in a sorted array | O(log n) | Halves the range at each step |
| Merge sort | Sort n items | O(n log n) | Needs O(n) extra memory |
| Quicksort | Sort n items | O(n log n) average | O(n²) in the worst case; sorts in place |
| Breadth-first or depth-first search | Visit every vertex | O(V + E) | With an adjacency list; V vertices, E edges |
Big-O describes how the cost grows as the input grows, not the exact time in seconds.
Examples of exercises used in lessons. The tutor picks ones that suit your course, and you write every line yourself.
Keep a history of edits so the last change can be undone and redone, with a limit on how much is remembered.
Practises
Store thousands of contacts, then compare searching a sorted array with binary search against a hash table you write yourself.
Practises
Model streets as a weighted graph and find the shortest route between two places, then explain why Dijkstra’s algorithm works.
Practises
Implement four sorting algorithms, time them on 1,000, 10,000 and 100,000 items, and check the results against their Big-O.
Practises
The tutor teaches, traces and reviews with you, but does not write graded assignments, contest solutions or test answers for you to submit.
These are the aims of the lessons. Progress depends on where you start and how much you practise, and we never promise grades or results.
DSA is an advanced course: it assumes you already program confidently. Students usually come to it at one of these points.
Level: Intermediate
Your university course has started with complexity, lists and stacks. Lessons follow its outline and make each structure concrete before the exam.
Level: Advanced
You know the structures but freeze on new problems. Lessons focus on recognising patterns, timed practice and explaining your approach.
Level: Advanced
You are on an algorithms course or want to go further. Lessons cover graph algorithms, greedy methods, dynamic programming and analysing recurrences.
DSA sits at the centre of a Computer Science degree. These courses come before it or build on it.
Classes, inheritance and design. Take this first if linked structures built from classes feel unfamiliar.
Pointers, references and memory, which many university DSA courses expect you to use in C++.
Operating systems, databases, networks and the other university subjects that use these structures.
Final-year students: choose the right structures and algorithms for your project with a mentor.
DSA classes are taught by the programming tutors below. Each profile is published with the tutor’s consent. When you get in touch, we suggest a tutor who knows your course language.

Tutor at My Subject Hub
Per subject, per month, in US, Canadian, Australian or New Zealand dollars, and in Saudi riyals with 20% off for students in Saudi Arabia. Every plan starts with a free trial class.
For students in the United States and every other country without its own price list, in US dollars.
$40per month, per subject
That’s $5 a class
2 classes a week = 8 classes a month, 60 minutes each, for $40 a month.
No credit card required
$60per month, per subject
That’s $5 a class
3 classes a week = 12 classes a month, 60 minutes each, for $60 a month.
No credit card required
$70per month, per subject
That’s $4.38 a class
4 classes a week = 16 classes a month, 45 minutes each, for $70 a month.
No credit card required
Each plan is for one subject. A second subject is a second plan.
For students in Canada, in Canadian dollars.
CA$55per month, per subject
That’s CA$6.88 a class
2 classes a week = 8 classes a month, 60 minutes each, for CA$55 a month.
No credit card required
CA$85per month, per subject
That’s CA$7.08 a class
3 classes a week = 12 classes a month, 60 minutes each, for CA$85 a month.
No credit card required
CA$100per month, per subject
That’s CA$6.25 a class
4 classes a week = 16 classes a month, 45 minutes each, for CA$100 a month.
No credit card required
Each plan is for one subject. A second subject is a second plan.
For students in Australia, in Australian dollars.
A$60per month, per subject
That’s A$7.50 a class
2 classes a week = 8 classes a month, 60 minutes each, for A$60 a month.
No credit card required
A$90per month, per subject
That’s A$7.50 a class
3 classes a week = 12 classes a month, 60 minutes each, for A$90 a month.
No credit card required
A$105per month, per subject
That’s A$6.56 a class
4 classes a week = 16 classes a month, 45 minutes each, for A$105 a month.
No credit card required
Each plan is for one subject. A second subject is a second plan.
For students in New Zealand, in New Zealand dollars.
NZ$70per month, per subject
That’s NZ$8.75 a class
2 classes a week = 8 classes a month, 60 minutes each, for NZ$70 a month.
No credit card required
NZ$105per month, per subject
That’s NZ$8.75 a class
3 classes a week = 12 classes a month, 60 minutes each, for NZ$105 a month.
No credit card required
NZ$120per month, per subject
That’s NZ$7.50 a class
4 classes a week = 16 classes a month, 45 minutes each, for NZ$120 a month.
No credit card required
Each plan is for one subject. A second subject is a second plan.
For students in Saudi Arabia, in Saudi riyals, with a 20% discount.
SAR 120per month, per subject
That’s SAR 15 a class
2 classes a week = 8 classes a month, 60 minutes each, for SAR 120 a month.
No credit card required
SAR 180per month, per subject
That’s SAR 15 a class
3 classes a week = 12 classes a month, 60 minutes each, for SAR 180 a month.
No credit card required
SAR 210per month, per subject
That’s SAR 13.13 a class
4 classes a week = 16 classes a month, 45 minutes each, for SAR 210 a month.
No credit card required
Each plan is for one subject. A second subject is a second plan.
Questions · 9
The questions students and parents ask us most, filed where you can find them. Pull a card to read it.
My Subject Hub gives live one-to-one online help with data structures and algorithms (DSA), in C++, Java or Python. Lessons follow your university course outline or test and cover Big-O, linked lists, stacks, queues, hashing, trees, graphs and sorting, and you practise by writing and testing each one yourself. The first 30-minute class is free.
C++, Java or Python, the one your course or test uses. The ideas are the same in every language; C++ also makes you handle pointers and memory yourself, which many university courses expect.
A way of describing how an algorithm’s running time or memory grows as the input grows, ignoring constant factors. O(n) means the work grows in proportion to the input; O(log n) means it grows very slowly, as in binary search. You learn to work it out from your own code in the first topic.
School algebra is enough to start. Logarithms, sums and proofs by induction are explained when a topic needs them, with examples from code rather than abstract exercises.
Yes. The tutor can focus on common problem types, timed practice, explaining your approach aloud and analysing complexity, alongside the data structures behind them.
You should write programs with loops, functions and arrays without help, and know what a class and an object are. If classes are new, a few OOP lessons first will make linked structures much easier.
Yes. Share your course outline and past papers, and the tutor follows its order and notation, including the pseudocode style your exams use.
There is no fixed length; it depends on where you start and what your course or test covers. The tutor suggests a plan after the free 30-minute class. DSA uses the monthly plans, from $40 a month (SAR 120 in Saudi Arabia).
Yes. Female tutors are available on request, and so are male tutors. Tell us your preference when you get in touch, and we confirm a matching tutor before the free class.
Not in the drawer? Send us your question and we reply within 24 hours.
Ask usMeet the tutor, trace a structure together, and find out where to start. Tell us your course or test, and we will arrange a time.
Can’t use WhatsApp? Call +92 317 5700456 or email info@mysubjecthub.com.