4 Replies - 2874 Views - Last Post: 17 August 2010 - 05:58 AM Rate Topic: -----

#1 Lemaire624  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 20-March 10

How can I sort without using sort method?

Posted 13 August 2010 - 01:43 AM

Hi. .

I am trying to figure out how to sort list of items in an array without actually using the method sort.

Example of this I enter a set of names and sort them in ascending order BUT without using the sort.

i think loop and ifs will be used?

I know this sounds funny but I think I'm curious..

This post has been edited by Lemaire624: 13 August 2010 - 03:14 AM

Is This A Good Question/Topic? 0
  • +

Replies To: How can I sort without using sort method?

#2 Cuzzie  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 72
  • View blog
  • Posts: 341
  • Joined: 16-July 10

Re: How can I sort without using sort method?

Posted 13 August 2010 - 03:58 AM

Well then, I guess you'll have to manually implement any sorting algorithms into your code. Check this out! :)
Was This Post Helpful? 0
  • +
  • -

#3 Lemaire624  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 20-March 10

Re: How can I sort without using sort method?

Posted 17 August 2010 - 02:10 AM

thanks for the reply..

but what if the user has entered a set of strings stored in an array?

is there any other way?
Was This Post Helpful? 0
  • +
  • -

#4 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: How can I sort without using sort method?

Posted 17 August 2010 - 05:45 AM

I guess I don't understand your question- if you want to sort it, you're either going to have to use the built-in sort or create your own sorting algorithm as Cuzzie suggested, which is what I thought you originally asked.
Was This Post Helpful? 0
  • +
  • -

#5 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: How can I sort without using sort method?

Posted 17 August 2010 - 05:58 AM

maybe show us the code you've used to try to implement this yourself and we might be able to steer you more in the right direction
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1