Problem 255 · Medium

Verify Preorder Sequence in Binary Search Tree

Verify that a sequence can be the preorder traversal of a binary search tree with distinct values.

Open the interactive visualisation