Math, asked by maharjansalvia, 4 months ago

What is the algorithm of differences of two numbers?

Answers

Answered by Anonymous
0

Answer:

Welcome to Gboard clipboard, any text that you copy will be saved here.Welcome to Gboard clipboard, any text that you copy will be saved here.Welcome to Gboard clipboard, any text that you copy will be saved here.

Answered by ananyanaskar28
3

Answer:

Just sort the array using counting sort which will take O(n) time and then go through the array from left to right and keep recording the difference between two consecutive elements and compare it with your current least difference.

So that'll be O(n) + O(n) ( one for sorting and one for going through the array) .

The above total running time is the worst case running time.

Similar questions