Timeline for Given two identical DOM trees find same node in tree B
Current License: CC BY-SA 4.0
Post Revisions
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Jun 27, 2021 at 23:39 | history | suggested | Hedayatullah Sarwary | CC BY-SA 4.0 |
Grammatical errors solved
|
| Jun 15, 2021 at 5:28 | review | Suggested edits | |||
| S Jun 27, 2021 at 23:39 | |||||
| Sep 1, 2020 at 11:08 | comment | added | CWright |
@greybeard thank you. a) would be constant to go from 1 node to its parent - a node simply has a .parentElement property. b) to visit all of a nodes children - it would be O(n) where n = number of children of that node. c) the height of the tree depends on if it's balanced or not. If it is, then it would be log(n) where n = nodes If it's not balanced - then it would be O(n) where n is the length of the longest path. b)
|
|
| Sep 1, 2020 at 4:01 | comment | added | greybeard | Welcome to COMPUTERSCIENCE @SE. What is a) the complexity of getting from one node to its parent b) the complexity of getting from one node to all of its children in turn c) the height of the tree(s)? | |
| Aug 31, 2020 at 18:50 | vote | accept | CWright | ||
| Aug 31, 2020 at 17:47 | answer | added | Steven | timeline score: 0 | |
| Aug 31, 2020 at 16:25 | review | First posts | |||
| Sep 1, 2020 at 4:01 | |||||
| Aug 31, 2020 at 16:23 | history | asked | CWright | CC BY-SA 4.0 |