今際の国の呵呵君
Wednesday, January 7, 2015
[LintCode]Insert Node in Binary Search Tree
很简单题,每个node决定是往左还是往右还是就是这个节点。类似二分的做法。
代码如下:
recursive版本:
iterative版本:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment