Leetcode Category
For my own reference:
Collection from Huahua
Collection from Cspiration. I collected it for my own usage.
Log(n) time to find lower bound and upper bound
For binary search of repeated elements in sorted array, the binarySearch in Java can not guarantee that the returned value is the first or last. So it will return a random index of these repeated elements.
Here we discuss how to return the first or last of such repeated element.
Constant Space Traversal in Binary Tree with Parent Pointer
The binary tree node has parent field.
inorder traversal with constant space.
Morris Traversal
Morris Traversal can traverse binary tree without recursion and stack, i.e. O(1) space usage.
In this article, we discuss the inorder Morris Traversal.
hello world
If you see this page, that means you have setup your site. enjoy!
You may want to config the site or writing a post next. Please feel free to create an issue or send me email if you have any questions.
24 post articles, 3 pages.