Skip to main content

New answers tagged

2 votes

Leet Code: 236. Lowest Common Ancestor of a Binary Tree

An alternative approach If we were making repeated inquiries on the same tree, there are two problems: It's not a balanced binary sort tree, so searching is O(n) rather than O(log n) or better. This ...
Chris's user avatar
  • 6,126
2 votes

Binary Search Tree implementation in C++ with templates

printValues Let's consider a function with opportunity for improvement. ...
Chris's user avatar
  • 6,126

Top 50 recent answers are included