Question: (char d, int maxcount) { Node* ptr = first; bool chk=false; Node* temp; while (ptr != NULL) { if (ptr->data == d) { chk =

(char d, int maxcount) { Node* ptr = first; bool chk=false; Node* temp; while (ptr != NULL) { if (ptr->data == d) { chk = true; int count = 0; temp = ptr; while (ptr != NULL) { if (ptr->data == d) { count++; ptr = ptr->next; } else break; } if (count > maxcount) { while (count > maxcount) { del_after(temp); count--; } } else if (maxcount > count) { while (count < maxcount) { ins_after(temp,d); count++; } } // else } // outer if ptr = ptr->next; } // while return chk; } What is the exact time complexity (number of steps) of the function ? Provide complete justification. 2. Write down the asymptotic time complexity of function using Big-O notation. 3. Explain the best and worst cases for function using Big-O notation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!