Click here to Skip to main content
16,017,684 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: [Message Deleted] Pin
DavidNohejl20-Mar-08 4:18
DavidNohejl20-Mar-08 4:18 
JokeRe: [Message Deleted] Pin
El Corazon20-Mar-08 7:37
El Corazon20-Mar-08 7:37 
GeneralRe: [Message Deleted] Pin
Pallab_GT21-Mar-08 0:09
Pallab_GT21-Mar-08 0:09 
GeneralRe: [Message Deleted] Pin
James R. Twine24-Mar-08 7:22
James R. Twine24-Mar-08 7:22 
QuestionCan linked list be sorted in O(n) time? Pin
doubtfire4000816-Mar-08 23:24
doubtfire4000816-Mar-08 23:24 
AnswerRe: Can linked list be sorted in O(n) time? Pin
Alan Balkany17-Mar-08 3:24
Alan Balkany17-Mar-08 3:24 
GeneralRe: Can linked list be sorted in O(n) time? Pin
Luc Pattyn17-Mar-08 4:08
sitebuilderLuc Pattyn17-Mar-08 4:08 
AnswerRe: Can linked list be sorted in O(n) time? Pin
Jörgen Sigvardsson14-Jun-08 11:47
Jörgen Sigvardsson14-Jun-08 11:47 
Not in a general way, no.

If you can map your objects uniquely to the natural numbers [0 .. n), then you can do it in O(n) with a storage complexity of S(n). Create an array the size of your list. Iterate through the list, and put each object in its corresponding slot in the array. Then iterate through the array, and rebuild your list.

This places a really bad constraint on your contained objects of course. But that's one price to pay for trying to do the impossible. Wink | ;) (It has been proven that you cannot come up with a general sorting algorithm faster than n log n)

--
Kein Mitleid Für Die Mehrheit

QuestionRotate Images for automatic alignment - suggestions for an algorithm please? Pin
justaudio12-Mar-08 11:53
justaudio12-Mar-08 11:53 
AnswerRe: Rotate Images for automatic alignment - suggestions for an algorithm please? Pin
Skippums13-Mar-08 5:24
Skippums13-Mar-08 5:24 
GeneralRe: Rotate Images for automatic alignment - suggestions for an algorithm please? Pin
justaudio13-Mar-08 9:48
justaudio13-Mar-08 9:48 
AnswerRe: Rotate Images for automatic alignment - suggestions for an algorithm please? Pin
Alan Balkany13-Mar-08 5:24
Alan Balkany13-Mar-08 5:24 
GeneralComputing Binary File Changes Pin
Skippums12-Mar-08 10:24
Skippums12-Mar-08 10:24 
GeneralRe: Computing Binary File Changes Pin
Member 419459326-Mar-08 8:43
Member 419459326-Mar-08 8:43 
QuestionRe: Computing Binary File Changes Pin
Skippums29-Mar-08 17:38
Skippums29-Mar-08 17:38 
GeneralRe: Computing Binary File Changes Pin
Member 419459329-Mar-08 18:27
Member 419459329-Mar-08 18:27 
GeneralRe: Computing Binary File Changes Pin
Member 419459330-Mar-08 6:48
Member 419459330-Mar-08 6:48 
QuestionRe: Computing Binary File Changes Pin
Skippums30-Mar-08 10:37
Skippums30-Mar-08 10:37 
GeneralRe: Computing Binary File Changes Pin
Member 419459330-Mar-08 12:38
Member 419459330-Mar-08 12:38 
GeneralRe: Computing Binary File Changes Pin
Member 419459316-Apr-08 16:19
Member 419459316-Apr-08 16:19 
GeneralRe: Computing Binary File Changes Pin
Skippums16-Apr-08 17:39
Skippums16-Apr-08 17:39 
GeneralRe: Computing Binary File Changes Pin
Member 419459316-Apr-08 18:50
Member 419459316-Apr-08 18:50 
GeneralRe: Computing Binary File Changes Pin
Skippums18-Apr-08 6:38
Skippums18-Apr-08 6:38 
GeneralRe: Computing Binary File Changes Pin
Member 419459327-Apr-08 8:25
Member 419459327-Apr-08 8:25 
GeneralRe: Computing Binary File Changes Pin
Skippums27-Apr-08 22:17
Skippums27-Apr-08 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.