1 votes 1 votes What is the worst case time complexity to count pairs of numbers with difference ‘k’ from an input array of ‘n’ numbers? a) O(logn) b) O(nlogn) c) O(n^2) d) O(n^2logn) Algorithms algorithms time-complexity made-easy-test-series madeeasy-testseries-2018 + – charul asked Jan 12, 2018 edited Mar 5, 2019 by ajaysoni1924 charul 694 views answer comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments Rohit Gupta 8 commented Jan 13, 2018 i edited by Rohit Gupta 8 Jan 13, 2018 reply Follow Share Use merge sort for sorting. In worst case O(nlogn) & O(nlogn) to find x-y = k. 0 votes 0 votes vishal chugh commented Jan 13, 2018 reply Follow Share But what is the need to sort if Worst Case Time complexity is asked? 0 votes 0 votes Rohit Gupta 8 commented Jan 13, 2018 reply Follow Share Worst case of best algo? 0 votes 0 votes Please log in or register to add a comment.