Inertia would keep them going the same speed as the car was going. therefore, the person not wearing a seatbelt would be sent flying forward, probably ending up dead
Answer:
Answer explained below
Explanation:
void bubbleSort(int X[], int Y[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
// Last i elements are already in place
for (j = 0; j < n-i-1; j++)
if (X[j] > X[j+1])
{
swap(X[j],X[j+1])
swap(Y[j],Y[j+1]);
}
if (X[j] == X[j+1]&&Y[j]<Y[j+1])
{
swap(X[j],X[j+1])
swap(Y[j],Y[j+1]);
}
}
Since the above algorithm contains 2 nested loops over n.
So, it is O(n^2)
Answer:
comment the choices please