check if in binary tree exist two elements whom difference is d. O(n)

前端 未结 0 1130
刺人心
刺人心 2021-02-06 06:48

Traverse Tree size of n In-order and copy elements into array size of n one by one. This way you get a sorted array in time complexity of O(n). if array is A[1...n] then declare

相关标签:
回答
  • 消灭零回复
提交回复
热议问题