In Order Successor in Binary Search Tree

前端 未结 17 1879
孤独总比滥情好
孤独总比滥情好 2020-11-27 04:11

Given a node in a BST, how does one find the next higher key?

17条回答
  •  感动是毒
    2020-11-27 04:35

    Check out here : InOrder Successor in a Binary Search Tree

    In Binary Tree, Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inoorder traversal. In Binary Search Tree, Inorder Successor of an input node can also be defined as the node with the smallest key greater than the key of input node.

提交回复
热议问题