Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,968 members, 7,956,624 topics. Date: Monday, 23 September 2024 at 03:43 PM |
Nairaland Forum / Science/Technology / Programming / What Do You Think About This Bubble Sort Method, Is It Efficient? (1410 Views)
Which Sync Method Is Best For Guarding Resources With Limited Capacity? / Nigeria Bank Sort Codes And Their Adresses / Solution Of Linear Programming Problems Using Simplex Method (2) (3) (4)
What Do You Think About This Bubble Sort Method, Is It Efficient? by Nobody: 4:24pm On Jul 24, 2014 |
I just wrote it, just now. you can test with this bubleSort(arr, arr.size());
|
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by Javanian: 1:56am On Jul 25, 2014 |
It looks okay, apart from the little overhead it may encounter as a result of adding and removing from from an array list rather than an array. 1 Like |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by asalimpo(m): 11:23pm On Jul 27, 2014 |
ikp4succes: I just wrote it, just now.you get zero for presentation. YOu should have copied that code out and posted in in plain text instead of torture the viewer from picking it out from a black background. - java has arrays.sort, which uses timsort, most efficient sorting algorithm so far for now. - use intuitive naming conventions. rename the variable firstto currentso that the intent of the code can be clearer. |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by Nobody: 3:06am On Jul 28, 2014 |
asalimpo: well its just 6 lines of code, you don't have to type it you could look at it to see why is not efficient. Also yes i knw they have arrays.sort but as a computer programmer you have to know the technic behind array.sort. you right i should have renamed it to current instead of first, i did this so fast. |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by Nobody: 3:11am On Jul 28, 2014 |
Javanian: It looks okay, apart from the little overhead it may encounter as a result of adding and removing from from an array list rather than an array. ye i knw about the memory use from array list instead of primitive arrays, since bubble sort sucks i don't think the time difference will matter anyway. |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by elvis10ten(m): 9:14pm On Jul 29, 2014 |
ikp4succes:primitive arrays ? An array is an object. An array that holds primitives or object references would be the right word? |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by Nobody: 11:58pm On Jul 29, 2014 |
elvis10ten: primitive arrays ? An array is an object. An array that holds primitives or object references would be the right word? but u get what am trying to say |
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by elvis10ten(m): 7:15am On Jul 30, 2014 |
ikp4succes: |
(1) (Reply)
Simple CRUD Application In PHP And Mysql – Part 2 / Program To Logoff, Restart, Hibernate And Shutdown Your System / How Do I Use A Dedicated VPS I Bought
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11 |