Update MP2 (idk anymore)
This commit is contained in:
@@ -143,19 +143,18 @@ std::vector<int> getRowMap(std::vector<std::tuple<int, int>> locationVector, int
|
||||
std::string printVector(std::vector<int> arr, std::vector<int> locationVector = {-1}) {
|
||||
std::string output = "{";
|
||||
std::map<std::string, int> columnMap;
|
||||
if (locationVector[0] != -1) {
|
||||
printf("%s", printVector(locationVector).c_str());
|
||||
}
|
||||
for (int i = 0; i < arr.size(); ++i) {
|
||||
// check if iteration value matches one of the locationVector values. If it does, append an ASCII color sequence.
|
||||
if (binarySearch(locationVector, i) == i) {
|
||||
int binSearchResult = binarySearch(locationVector, i);
|
||||
//printf("bin search result:%i", binSearchResult);
|
||||
if (binSearchResult > -1) {
|
||||
output.append(colorIterator());
|
||||
}
|
||||
output.append(std::to_string(arr[i]));
|
||||
if ((arr.size() - 1) > i) {
|
||||
output.append(", ");
|
||||
}
|
||||
if (binarySearch(locationVector, i) == i) {
|
||||
if (binSearchResult > -1) {
|
||||
|
||||
output.append(COLOR_WHITE.c_str());
|
||||
}
|
||||
|
Reference in New Issue
Block a user