Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparing sorting algorithms  RSS feed

 
Aron Silvester
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm comparing 4 types of sorting algorithms. Bubble sort (pair-wise), selection sort, merge sort, and quick sort. How do I go about finding out what each algorithms memory usage so I can compare them to each other???
 
Liutauras Vilda
Marshal
Posts: 4649
318
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aron Silvester wrote:I'm comparing 4 types of sorting algorithms. Bubble sort (pair-wise), selection sort, merge sort, and quick sort. How do I go about finding out what each algorithms memory usage so I can compare them to each other???
Memory usage Why do you need to know that?

Aren't you interested in time complexity for each of them? Try to read about time complexity (<- link) and most popular sorting algorithms, (<- link) you might find some answers you're looking for.
 
Campbell Ritchie
Marshal
Posts: 55751
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look for whether the algorithms are stable or not, that is also useful to know.
 
Stephan van Hulst
Saloon Keeper
Posts: 7817
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keep in mind that all these sorting algorithms can be performed 'in-place'. At the cost of speed, stability and/or clearness, they can be performed using a constant amount of memory.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!