Home > Programming > Announcement! BST and Merge Sort are broken!

Announcement! BST and Merge Sort are broken!

Believe it or not! it like what the title says!.. I was shocked today when our Teaching Assistance on Algorithms class said that the binary search tree algorithm we are using for decades has a bug found last year!

Recall this: mid = (low + high) / 2;

Its part of many algorithms, for few decades we were using this line of code on our programming lines and algorithms. Unfortunately, many programmers had missed this mistake. The bug is when you add both integers together and resulted an integer value higher than the max possible values of integer, the value becomes a negative value!

More information click here!

Categories: Programming Tags: