BSTArray Lab

BSTArray Lab

Practice writing methods for an array-based Binary Search Tree Β· run tests Β· compare step by step Β· trace line by line

Ready
Exercises add methods to BSTArray
Interactive Test run calls one by one and compare with the correct answer

Pick a method, fill in its arguments and press Run & compare. Your code and the correct answer run the same calls, and you see the first step where they differ: return value, exception, array, size or depth.

Examples
14.5
Scratch pad trees, boxes, pointers…
Draw anything here: a tree you expect, boxes for the Stack, arrows for pointers…
Your drawing is kept in this browser.

Getting ready…

Size
Output System.out

BSTArray Lab Β· Below the exercises is a line-by-line Java runner: the BSTArray.java tab is your code (saved in this browser automatically), the Ex…Test.java tab holds the tests, and the Main.java tab holds the calls from the Interactive Test Β· A small Java interpreter that runs in your browser. Supports multiple files, classes, interfaces, inheritance, generics, recursion, arrays, ArrayList / LinkedList / Stack / Queue / HashMap, Scanner, lambdas, try/catch and JUnit-style tests. The Calls tab draws every method call as a tree, so you can watch recursion go down and the return values come back up. Mark a tree with // @tree or // @tree n=3 at the end of a declaration.