Complete the code to declare an array of 5 integers.
int arr[[1]];The array size should be 5 to hold 5 integers.
Complete the code to find a value in a linked list by iterating nodes.
while (current != nullptr && current->value != [1]) { current = current->next; }
We compare each node's value to the target value we want to find.
Fix the error in the hash map lookup code to get the value for a key.
auto it = map.find([1]); if (it != map.end()) { return it->second; } else { return -1; }
We must search the map using the key, not the value or other terms.
Fill both blanks to create a loop that searches an array for a target value.
for (int i = 0; i [1] n; i[2]) { if (arr[i] == target) { return i; } }
The loop runs from 0 up to but not including n, incrementing i by 1 each time.
Fill all three blanks to create a hash map insertion with key and value.
std::unordered_map<std::string, int> map; map[[1]] = [2]; int val = map[[3]];
We insert value 5 for key "apple" and then retrieve it using the same key.
