@Override
    public void sort(ObservableArray tab) {

        // Search value for the i th position
        for (int i = 0; i < tab.length; i++) {
            int indexOfNextSmallest = i;
            // Search for the next smallest value
            for (int j = i + 1; j < tab.length; j++) {
                if (tab.Less(j, indexOfNextSmallest)) {
                    indexOfNextSmallest = j;
                }

            }
            tab.exchange(i, indexOfNextSmallest);
        }
    }