• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

I can't get seem to get this quicksort algorithm to work...

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help me? I've tried and tried and tried, but I can't seem to get this quicksort algorithm to work. I can't seem to find whats wrong with it. The sorting is perfect in most cases except one of the number is out of place. Sometimes, an infinite loop occurs. Here's the code:


Please help inspecting it. Thank you very much.
[ May 19, 2005: Message edited by: Tom Liu ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the minimal sequence of ints that fails to get sorted correctly?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try entering a sequence of values that cause an infinite loop to occur and then step with any IDE debugger to see what fails. This should reveal the problem.
[ May 23, 2005: Message edited by: Mihai Alexe ]
 
Onion rings are vegetable donuts. Taste this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic