0 votes 0 votes Which of the following algorithms sort $n$ integers, having the range $0$ to $(n^2 -1)$, in ascending order in $O(n)$ time? Selection sort Bubble sort Radix sort Insertion sort Algorithms ugcnetcse-june2015-paper2 algorithms-sorting + – go_editor asked Jul 31, 2016 • edited Jun 2, 2020 by soujanyareddy13 go_editor 4.1k views answer comment Share Follow See 1 comment See all 1 1 comment reply Sanjay Sharma commented Oct 29, 2017 reply Follow Share Only Radix sort among options can sort in linear time i.e O(n) rest are comparison sorts so ans is C 1 votes 1 votes Please log in or register to add a comment.
Best answer 0 votes 0 votes ans c except radix sort all given algorithms take O(n^2) time so ans is radix sort it performs sorting digit by digits taking O(n) time qwertyui answered Jul 31, 2016 • selected Jun 2, 2020 by soujanyareddy13 qwertyui comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Radix sort take O(N) time . Prashant. answered Jul 31, 2016 Prashant. comment Share Follow See all 2 Comments See all 2 2 Comments reply cse23 commented Jul 31, 2016 reply Follow Share how??? can u explain.. 0 votes 0 votes Prashant. commented Jul 31, 2016 reply Follow Share Radix sort run loop = Max no. of digits in one Number and Number of digit is constant [can't be n]. so loop run n times only. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Selection sort takes O(n2) time. Bubble sort takes O(n2) time. Radix sort takes O(n) time. Insertion sort takes O(n2) time. So, option (C) is correct. Prasanjeet Ghosh answered Jun 25, 2018 Prasanjeet Ghosh comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes https://www.geeksforgeeks.org/radix-sort/ shruti gupta1 answered Mar 31, 2019 shruti gupta1 comment Share Follow See all 0 reply Please log in or register to add a comment.