How to use the assistant
1. Get an OpenRouter key
Create a free account at openrouter.ai and make an API key. Paste it into the key field — it goes only to openrouter.ai when you generate, and is remembered only if you opt in. Free models work without buying credits.
2. Pick a drill and a model
Start on the home page and pick one of the four drills — iterative or recursive, binary tree or binary search tree — to match what you want to practice. Each opens its own page (bookmark it to come straight back), where the model picker lists free models first and stronger paid ones below; if the list fails to load, type any OpenRouter model id. Use "All question types" to switch drills.
Which model? A free one is enough to practise with. If you can spend a little, a current paid model such as openai/gpt-5 writes questions set in realistic situations and passes this app's checks more often, so you wait less. Cheaper models occasionally run words together in the question text.
3. Generate, solve, then reveal
Generate a question and try to solve it on paper or in your editor before pressing "Show solution" — the two walkthroughs are designed so the first one clarifies the problem without spoiling the approach. Generate another question when you are done; the assistant steers the model away from your last few questions.
Every question is checked automatically before you see it: is it complete, is it the type you asked for, and does it avoid the known traps (a BST solution that walks the whole tree, a walkthrough that gives the approach away). One that fails is quietly replaced, up to three tries. The checks cannot prove a solution correct, so hold it against the course notes.
4. Keep your practice
The questions you generate are listed under "Your questions", solutions included, in this browser only. Download them as a Markdown file, or press "Save as PDF" and choose "Save as PDF" in your browser's print dialog. The last 30 are kept; Clear history removes them.
Study tips
- BST solutions should follow a single path down the tree in O(log n) — if a generated BST solution visits every node, treat it as a red flag and generate a fresh question.
- Iterative questions must use loops, recursive ones must use recursive calls — check the solution honors this before trusting it.
- Questions are AI-generated: read them critically, and see About & privacy for what that means.
The course notes behind this
The drills rehearse one chapter's code. These are the pages behind them — one working implementation to compare your answer against, not a marking key: yours may differ and still be right.
- Introduction to BST — the ordering property, and what insertion, removal, and the four traversals each have to preserve. Every drill assumes it.
- Implementation — class declaration — the Node and tree class declaration every drill's answer is written against.
- Implementation — iterative methods — insert and search as loops, plus the queue-driven breadth-first print. The two iterative drills.
- Implementation — recursive methods — search, insert, and the in/pre/post-order prints written recursively. The two recursive drills.