You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int NUM_ELEMENTS = 0;
// Get a pointer to an array
apultra_arrival** pDestSlotsPtr = &pDestSlots;
// Size of the entire pointer array
size_t arraySize = sizeof(*pDestSlotsPtr);
// Size of one pointer
size_t elemSize = sizeof(*pDestSlotsPtr[0]);
// Calculate the number of elements
NUM_ELEMENTS = arraySize / elemSize;
int left = 0;
int right = NUM_ELEMENTS - 1; // NUM_ELEMENTS - size of the pDestSlots array
while (left <= right) {
int mid = left + (right - left) / 2;
if (pDestSlots[mid].cost < nCodingChoiceCost) {
left = mid + 1;
}
else {
right = mid - 1;
}
}
int n = left; // found index
my optimization
after this code
The text was updated successfully, but these errors were encountered: