Saltar al contenido principal

12 documentos etiquetados con "binary-search-tree"

Ver Todas las Etiquetas

Increasing Order Search Tree

Given a binary search tree, rearrange the tree such that it forms a linked list where all its values are in ascending order.

Insert into Binary Search Tree

Given the reference to a binary search tree and a value to insert, return a reference to the root of the tree after the value has been inserted in a position that adheres to the invariants of a binary search tree.

Level Up Binary Search Tree

Given the reference to a binary search tree, "level-up" the tree. Leveling-up the tree consists of modifying every node in the tree such that every node's value increases by the sum of all the node's values that are larger than it.

Mode in Binary Search Tree

Given a binary search tree, return its mode (you may assume the answer is unique). If the tree is empty, return -1. Note: the mode is the most frequently occurring value in the tree.

Search in a Binary Search Tree

Given the reference to the root of a binary search tree and a search value, return the reference to the node that contains the value if it exists and null otherwise.

Two Sum IV - Input is a BST

Given the reference to the root of a binary search tree and a target value, return whether or not two individual values within the tree can sum to the target.