My Math Forum  

Go Back   My Math Forum > College Math Forum > Applied Math

Applied Math Applied Math Forum


Reply
 
LinkBack Thread Tools Display Modes
April 10th, 2016, 01:55 AM   #1
Member
 
Joined: Mar 2015
From: USA

Posts: 34
Thanks: 1

Sorting n real numbers in O(n), when number of digits is bounded

I need to explain how to modify radix sort, in order to sort n real numbers, when every number has O(1) digits.
General and short description is enough.

I thought of making the numbers to have same number of digits left and right to the decimal point, then sort with radix sort only the negative numbers and make sure they will be afterwards in the beginning of the array (before the non-negative numbers, can be implmented at O(n)).
Finally- sort the rest of the numbers with radix sort.

Is there anything wrong with that?
Lobinho is offline  
 
Reply

  My Math Forum > College Math Forum > Applied Math

Tags
bounded, digits, number, numbers, real, sorting



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Similarity between two lists of real number, where the numbers lie in the range [0,1] karanv10111 Advanced Statistics 2 June 2nd, 2014 12:45 PM
A number sorting activity grangeeducation Elementary Math 2 May 29th, 2014 01:35 AM
The last two digits of LARGE numbers? ricsi046 Number Theory 2 November 10th, 2013 05:31 AM
find four -digits numbers m ,n and k Albert.Teng Algebra 2 July 15th, 2012 08:14 PM
How many digits does this number have? brangelito Algebra 1 June 13th, 2010 08:29 AM





Copyright © 2019 My Math Forum. All rights reserved.