Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Off-Topic-Archive > Need help with Java
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 15:49
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Need help with Java Full PM-box? Change here!

Does anyone know where I can find the sourcecode for Quick Search, Merge Search and Heap Search?

I need the source code, because our teachers told us to download them from the internet, and we should comment the different lines in the code, so they know we understand it. Our assignment isn't based on the "do-it-yourself", because we didn't have enough time for this assignment to actually do it ourself.

Does anyone know where I can find those?

Skanky Burns is offline Skanky Burns
Deity
Skanky Bastard Quartermaster
Aug 2001
time: 14:31
  Old Post 21-09-2003 16:19
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Help yourself to an AD-FREE life

Sorry, a quick search (grin) with google didn't turn up anything interesting with any of them.

Skanky Burns is offline Skanky Burns
Deity
Skanky Bastard Quartermaster
Aug 2001
time: 14:31
  Old Post 21-09-2003 16:22
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Full PM-box? Change here!

Goldmine!

http://www.cs.ubc.ca/spider/harriso...rting-demo.html

and if that doesn't help, some more from sun
http://java.sun.com/docs/books/tuto...ons/algorithms/

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 16:22
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

Thx, I'll take a look

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 16:32
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

Do you know an easy way to compile SortAlgorithm.jav and SortItem.java?

I can't find them as class files, and I can't compile them because file1 needs file2, and file2 needs file1

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 16:36
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton buy from Amazon

Nevermind, found the way

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:31
  Old Post 21-09-2003 18:05 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton or Terrorists Win

how?

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 18:07
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Remove this text

By opening the files in a project (I'm using JCreator)

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:31
  Old Post 21-09-2003 18:11 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Put an end to popups!

cunning

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 21-09-2003 18:19
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Enter the AD-FREE zone

Could someone please take a look at my code and tell me what's wrong here?


Tester.java is the execution file.
I'm having problems with HeapSort.java

I have included a lot of System.out.println's to find the error, but I can't seem to find anything wrong in the code.

For some strange reason it just stops in the middle of the for-loop in heapSort method

Can someone see what's wrong here?

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:31
  Old Post 21-09-2003 21:15
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

Shouldn't you use v[] instead of data[] inside HeapSort?

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 22-09-2003 14:44
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Avatar Enlargement: We've got the solution

Uhmm... I guess so, but this doesn't make any difference. The problem is the pause(); methods. I don't understand why they're included. If I don't include them it goes on forever, but if I include them, the program ends with a pause(); (Using the System.out.println("Pause1"); line in the pause(); method)

Skanky Burns is offline Skanky Burns
Deity
Skanky Bastard Quartermaster
Aug 2001
time: 14:31
  Old Post 22-09-2003 15:05
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton buy from Amazon

Which line exactly does it stop at, or which for loop?
What are the variables doing just before it stops responding?

Have your println call display the values of the variables used in that particular section of code, it should help point out the problem.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 22-09-2003 15:10
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton, buy Call to Power 2

In HeapSort line 101 it calls the medhod pause(), which is line 61 - 67 in class SortAlgorithm

The last thing it does before stopping is printing "Pause1" (line 65). I have checked, it doesn't enter this:

if (stopRequested)
{
throw new Exception("Sort Algorithm");
}

Urban Ranger is offline Urban Ranger
Apolyton Duke of Off-Topic

Donate to the Red Cross
The City State of Noosphere, CPA special envoy
May 1999
time: 13:31
  Old Post 22-09-2003 20:33
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Got spare money?

The pause() method is part of Java's AWT. It seems like it was included to be used as part of some sorting demo program. I think you can take it out.

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 22-09-2003 20:39
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Got spare money?

I have tried to take it out, but if I do it, it makes something strange. It prints out like this:

(...)
5
44
89
1
56
4
8
12
11
18
(...)

It has printed very much, before I get the chance to stop the print's, which makes it impossible to see where it fails

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 22-09-2003 22:24
Edit/Delete Message Reply w/Quote
#17 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

I just found a MergeSort.class file, but somethings weird about it. When sorting, the graf shows it mostly only takes 0-10 milliseconds to sort 5000 ints

The funny thing is, when I insert some System.out.print()'s to check to see if it really sorts it, the array is actually sorted... sounds too fast to be true...

Adagio is offline Adagio

Emperor

Jun 2001
time: 06:31
  Old Post 22-09-2003 22:33
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Support Apolyton buy from Amazon

Just tried the test with 50,000 ints, but it still sorted correctly, and this within 10 milliseconds...

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:31.
Apolyton Time is 00:31.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0630 seconds (92.47% PHP - 7.53% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net