Nitpy-TnP-week-05 -TREES(EDITORIAL)

Revision en8, by beyondpluto, 2022-05-28 15:04:41

B. Binary-tree-array:

Tutorial

B. Binary-tree-array:

Just convert the string into binary notation.
ie:L to 0 and R to 1.
let that value be b in decimal.
then the answer will be 2^n+b. where 2^n is the position of first node at height n, and b is distance between first node at height n and position of node having sequence of traversal(from root 1) as binary representation of b.
note: hidden node will be at height n.

code

fhf

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en39 English beyondpluto 2023-03-16 19:48:37 29 Tiny change: 'hallenges/binary-tree-array"> C. Edge' -> 'hallenges/edge-vs-node-mapping"> C. Edge'
en38 English beyondpluto 2022-05-30 13:48:33 0 (published)
en37 English beyondpluto 2022-05-30 13:47:34 232
en36 English beyondpluto 2022-05-30 13:45:17 630
en35 English beyondpluto 2022-05-30 13:41:00 8
en34 English beyondpluto 2022-05-30 13:38:09 97 (saved to drafts)
en33 English beyondpluto 2022-05-29 20:59:36 0 (published)
en32 English beyondpluto 2022-05-29 20:58:34 208
en31 English beyondpluto 2022-05-29 08:41:05 5 Tiny change: 'n initial - maximum' -> 'n initial tree - maximum'
en30 English beyondpluto 2022-05-29 08:40:27 48 Tiny change: 'ach.\n<br>\n</sp' -> 'ach.\n<br><br>Overall complexity: O(n) worst case.<br>\n</sp'
en29 English beyondpluto 2022-05-29 08:39:42 1823
en28 English beyondpluto 2022-05-28 16:58:00 8
en27 English beyondpluto 2022-05-28 16:56:45 51
en26 English beyondpluto 2022-05-28 16:54:02 15
en25 English beyondpluto 2022-05-28 16:51:05 4 Tiny change: '`2^n+b`.\nwhere 2^n ' -> '`2^n+b`.\n<br>where 2^n '
en24 English beyondpluto 2022-05-28 16:49:57 6
en23 English beyondpluto 2022-05-28 16:47:54 4
en22 English beyondpluto 2022-05-28 16:46:58 2 Tiny change: 'eight n.\n\n<br>Over' -> 'eight n.\n<br>Over'
en21 English beyondpluto 2022-05-28 16:46:41 63
en20 English beyondpluto 2022-05-28 16:40:38 246
en19 English beyondpluto 2022-05-28 16:33:22 3593
en18 English beyondpluto 2022-05-28 15:46:46 28
en17 English beyondpluto 2022-05-28 15:46:01 3473
en16 English beyondpluto 2022-05-28 15:14:28 3 Tiny change: '"../../../i' -> '"../../../../i'
en15 English beyondpluto 2022-05-28 15:14:06 9 Tiny change: '<a href="instagram.' -> '<a href="../../../instagram.'
en14 English beyondpluto 2022-05-28 15:13:11 13 Tiny change: '<a href="google.com">####' -> '<a href="instagram.com">####'
en13 English beyondpluto 2022-05-28 15:12:11 29
en12 English beyondpluto 2022-05-28 15:08:55 15 Tiny change: 'ight n.\n<spoiler' -> 'ight n.\n</spoiler>\n<spoiler'
en11 English beyondpluto 2022-05-28 15:07:57 30
en10 English beyondpluto 2022-05-28 15:07:07 64
en9 English beyondpluto 2022-05-28 15:06:26 4
en8 English beyondpluto 2022-05-28 15:04:41 156
en7 English beyondpluto 2022-05-28 15:02:14 378
en6 English beyondpluto 2022-05-28 14:43:44 34
en5 English beyondpluto 2022-05-28 14:01:36 35
en4 English beyondpluto 2022-05-28 13:54:40 36
en3 English beyondpluto 2022-05-28 13:54:21 48
en2 English beyondpluto 2022-05-28 13:53:59 77
en1 English beyondpluto 2022-05-28 13:52:54 231 Initial revision (saved to drafts)