Home /
Expert Answers /
Computer Science /
need-urgently-write-an-algorithm-in-pseudocode-that-takes-as-input-a-binary-search-tree-bst-pa455
(Solved): NEED URGENTLY
Write an algorithm in pseudocode that: - takes as input a binary search tree (BST) ...
NEED URGENTLY
Write an algorithm in pseudocode that: - takes as input a binary search tree (BST) \( t \) - changes each node of the tree by subtracting the node's level from its value (i.e. its key). For example, the value of the root node will not change because the root is at level 0. Determine the complexity of your algorithm for a balanced tree with \( \mathrm{m} \) nodes and height \( O(\log \mathrm{m}) \). Is the resulting tree always a binary search tree? Why or why not? (a) Algorithm code begins - - code ends (b) Complexity for a balanced tree with \( \mathrm{m} \) nodes Answer: (c) Is the resulting tree always a BST? Why or why not: