Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,018 members, 7,806,980 topics. Date: Wednesday, 24 April 2024 at 08:09 AM

What Do You Think About This Bubble Sort Method, Is It Efficient? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / What Do You Think About This Bubble Sort Method, Is It Efficient? (1382 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)

(1) (Reply) (Go Down)

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 can test with this bubleSort(arr, arr.size());
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
first
to
current
so 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:
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
first
to
current
so that the intent of the code can be clearer.


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:

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.
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 tongue
Re: What Do You Think About This Bubble Sort Method, Is It Efficient? by elvis10ten(m): 7:15am On Jul 30, 2014
ikp4succes:

but u get what am trying to say tongue
wink smiley cheesy cheesy cheesy cheesy cheesy

(1) (Reply)

Optimizations: Some Sketchy Rants / Real Time!!! Java And C++ Which Has More Advantage. Drop Reviews Please / C++ Programmer Is Needed

(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. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.