codementor on Nostr: Question: Check whether a binary tree is a binary search tree. Assume all values are ...
Question: Check whether a binary tree is a binary search tree. Assume all values are different.
What must be true for every node, and how do you check it?
(CtCI 4.5)
Try to answer before you open the reply.
#tg005 · TG-005-Q1
Published at
2026-10-26 13:07:54 UTCEvent JSON
{
"id": "c50db541392a36b5fb4dd95ff755bb5cacaf3e639fa70a7f6cfa99c63aad4d89",
"pubkey": "e68a0856e90d9997b1f721e905249896412dd570399a987b2e8fd5e7fcfe2279",
"created_at": 1793020074,
"kind": 1,
"tags": [
[
"t",
"tg005"
]
],
"content": "Question: Check whether a binary tree is a binary search tree. Assume all values are different.\n\nWhat must be true for every node, and how do you check it?\n\n(CtCI 4.5)\n\nTry to answer before you open the reply.\n\n#tg005 · TG-005-Q1",
"sig": "d99d75084503fba10dd9e076d1a841911eff2fa8d12f9544288cf91be797b75856dd24372b8691fc9cfd2935e125b936d71f2fe492851c2ec523eb86c59c2bff"
}