Search found 137 matches

by Wesley
Tue 06 Oct, 2009 1:19 pm
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28380

Re: Stack and Heap

Okay, a more detailed description of the goal is here . 1) The strings can be as long as 500,000 characters long (or longer). My goal is to make my program work for 500,000 character-long strings. 2) I am coding in Java. That was a good question, since Java handles memory quite differently from othe...
by Wesley
Mon 05 Oct, 2009 9:42 pm
Forum: Programming Help
Topic: Stack and Heap
Replies: 18
Views: 28380

Stack and Heap

I won't go into too much detail of what I'm doing right now for the sake of time. I was wondering if anyone has any good ideas on memory usage regarding arrays. I am implementing the Needleman-Wunsch algorithm for comparing two strings. The first and most easy idea to implement is that of a 2D array...
by Wesley
Sat 03 Oct, 2009 12:55 am
Forum: Programming Help
Topic: Batch Files
Replies: 4
Views: 10503

Re: Batch Files

Okay, but what if I want to use the command:
java MakeChange

and the program MakeChange uses the command line?

I tried putting the command in a .cmd file (it works for .bat too), but it keeps running the command over and over again, infinitely...
by Wesley
Fri 02 Oct, 2009 10:50 pm
Forum: Programming Help
Topic: Batch Files
Replies: 4
Views: 10503

Batch Files

So, I was just curious. How would I create a batch file that ran a command when I opened it (or double clicked it)?

For instance, I want the command line to execute:
>javac *.java
by Wesley
Mon 28 Sep, 2009 1:29 pm
Forum: Off Topic
Topic: Post Your Internet speeds
Replies: 42
Views: 129173

Re: Post Your Internet speeds

Image

Okay, that's more like what I get at school. The old one was when I was connected through my laptop. The upload speed isn't the best though...

EDIT: I have the highest download speed :o
by Wesley
Sun 20 Sep, 2009 3:00 am
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

No problem. My code is quite inefficient and is kinda messy, but it sufficeth me to have the problem figured out! When I mentioned in my email to my professor how I had implemented my brute force algorithm, he was asking me to send him my solution. I think "factoradics" sparked his interes...
by Wesley
Sun 20 Sep, 2009 1:25 am
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

YES!!! I have accomplished the task! That sure took a long time! Debugging is the worst. If anyone would like to try out the program, I will post it for a minimal time somewhere. Or I could just post up the .class files and leave out the code. But if anyone is interested, I will be happy to let you ...
by Wesley
Sat 19 Sep, 2009 9:21 pm
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

Okay, I got everything to work, EXCEPT the copying of nodes part. I just want to make separate node lists rather than having all of the nodes reference the same list.

I don't know how to do it!!! It drives me nuts!

I will email one of my professors and see if he has any insight.
by Wesley
Sat 19 Sep, 2009 7:02 pm
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

I'm not sure how many errors there are with that code, but I just noticed one that I don't know how to fix. When I invoke the following code: copy = first; I'm not actually creating a separate node list, but both first and copy are pointing to the same node list. Any ideas on how to make a direct co...
by Wesley
Sat 19 Sep, 2009 4:03 pm
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

Hm... I'm not quite sure where I've gone wrong. Can anyone else spot it? // c is the decimal permutation // count is the number of elements // factoradic() stores the correct permutation in factArray // all of the nodes are loaded in the order they were in the file and are linked to first for (int i...
by Wesley
Sat 19 Sep, 2009 8:56 am
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

Yeah, I should've rephrased what I said about seeing other people's code. What I was referring to were the people (usually students) who go snooping around for code to pass along as their "original" homework. I think I almost have it. I only have to debug my code now. But it being 3:00am, ...
by Wesley
Sat 19 Sep, 2009 4:02 am
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

Okay, I'm going to try and run through the possible permutations of 3 cities using factoradic. So, don't we take from the original set of elements every time we compute the new factoradic permutation? We begin with: Permutation 1: 0 0 0 A B C Permutation 2: 0 1 0 A C B Permutation 3: 1 0 0 B A C Per...
by Wesley
Sat 19 Sep, 2009 2:11 am
Forum: Programming Help
Topic: [Script] The for Loop
Replies: 1
Views: 6652

[Script] The for Loop

Okay, I was looking at some scripting language and I could understand everything but this bit

Code: Select all

for i in xrange(j, 1, 1)

and

g = []
What does this mean? How would it look in C, C++, or Java?
by Wesley
Sat 19 Sep, 2009 2:01 am
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

This is getting really exciting. I think I'm starting to understand factoradics more. But how would I generate the next factoradic? Once I have the pointers, I think I might be able to move my nodes into a new permutation list. Oh, and I don't have to have the first node static. If this works for no...
by Wesley
Fri 18 Sep, 2009 8:44 pm
Forum: Programming Help
Topic: [Java] Nodes (Circularly Linked Lists)
Replies: 27
Views: 37952

Re: [Java] Nodes (Circularly Linked Lists)

Wowsers! I said before that I could determine the code needed if I could figure out the algorithm, but in this case it's quite different. Or maybe (most likely) I'm just not understanding the algorithm. Recursion would definitely have to be used, I can see. However, actually implementing the recursi...