code for adarius

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
625 B
2
Indexable
Never
else if (addresses[mid].getStreetName().compare(streetName) == 1)
        return searchAddress(addresses, houseNumber, streetName, low, mid - 1);
    else if (addresses[mid].getStreetName().compare(streetName) == -1)
        return searchAddress(addresses, houseNumber, streetName, mid + 1, high);
    else { // Then search by house number if the street address matches
        if (addresses[mid].getHouseNumber() > houseNumber)
            return searchAddress(addresses, houseNumber, streetName, low, mid - 1);
        else
            return searchAddress(addresses, houseNumber, streetName, mid + 1, high);
    }