Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
fp:lab05 [2022/03/31 08:51]
pdmatei
fp:lab05 [2022/03/31 08:53] (current)
pdmatei
Line 63: Line 63:
 **5.2.6.** Implement a method ''​depth''​ which returns the maximal depth of a BST. Hint: use the method: ''​_.max(_)''​. **5.2.6.** Implement a method ''​depth''​ which returns the maximal depth of a BST. Hint: use the method: ''​_.max(_)''​.
  
-**5.2.8.** Implement a method ''​minimum''​ which returns the smallest integer from a BST. (If the tree is empty, we return -1). Hint: use the example above, to guide your implementation.+**(!) 5.2.8.** Implement a method ''​minimum''​ which returns the smallest integer from a BST. (If the tree is empty, we return -1). Hint: use the example above, to guide your implementation.
  
 **5.2.9.** Implement a similar method ''​maximum''​. ​ **5.2.9.** Implement a similar method ''​maximum''​. ​
  
-**5.2.10.** Implement a method ''​successor(k)''​ which returns **the smallest** integer from the BST, which is **larger** than ''​k''​. Use the following examples for your implementation:​+**(!) 5.2.10.** Implement a method ''​successor(k)''​ which returns **the smallest** integer from the BST, which is **larger** than ''​k''​. Use the following examples for your implementation:​
 <​code>​ <​code>​
     5             ​t.successor(2) = 5                      ​     5             ​t.successor(2) = 5                      ​
Line 76: Line 76:
 </​code>​ </​code>​
  
-**5.2.11.** Implement a method ''​remove(k)''​ which removes element ''​k''​ from the BST.+** (!!) 5.2.11.** Implement a method ''​remove(k)''​ which removes element ''​k''​ from the BST.