codementor on Nostr: Question: A candidate checks only that each node's left child is smaller and its ...
Question: A candidate checks only that each node's left child is smaller and its right child is bigger.
Why is that not enough? Give a tree that passes their check but is not a BST.
Try to answer before you open the reply.
#tg005 · TG-005-Q2
Published at
2026-10-28 09:07:48 UTCEvent JSON
{
"id": "ee988ba628d2655df04ca1ba5d7b869a5fbe243bfce7ac8f8b28cf64e5dbfb9a",
"pubkey": "e68a0856e90d9997b1f721e905249896412dd570399a987b2e8fd5e7fcfe2279",
"created_at": 1793178468,
"kind": 1,
"tags": [
[
"t",
"tg005"
]
],
"content": "Question: A candidate checks only that each node's left child is smaller and its right child is bigger.\n\nWhy is that not enough? Give a tree that passes their check but is not a BST.\n\nTry to answer before you open the reply.\n\n#tg005 · TG-005-Q2",
"sig": "ddd30137d87c171ff292d5965070f2e4b2ea688de04fee950636c81b7eb9a1e623411383c8f40995013a599c2bd7501585318511166b2c1564373a8dde29bb52"
}