Search found 137 matches
- Tue 06 Oct, 2009 1:19 pm
- Forum: Programming Help
- Topic: Stack and Heap
- Replies: 18
- Views: 34738
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...
- Mon 05 Oct, 2009 9:42 pm
- Forum: Programming Help
- Topic: Stack and Heap
- Replies: 18
- Views: 34738
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...
- Sat 03 Oct, 2009 12:55 am
- Forum: Programming Help
- Topic: Batch Files
- Replies: 4
- Views: 14340
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...
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...
- Fri 02 Oct, 2009 10:50 pm
- Forum: Programming Help
- Topic: Batch Files
- Replies: 4
- Views: 14340
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
For instance, I want the command line to execute:
>javac *.java
- Mon 28 Sep, 2009 1:29 pm
- Forum: Off Topic
- Topic: Post Your Internet speeds
- Replies: 42
- Views: 145592
- Sun 20 Sep, 2009 3:00 am
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...
- Sun 20 Sep, 2009 1:25 am
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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 ...
- Sat 19 Sep, 2009 9:21 pm
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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.
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.
- Sat 19 Sep, 2009 7:02 pm
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...
- Sat 19 Sep, 2009 4:03 pm
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...
- Sat 19 Sep, 2009 8:56 am
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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, ...
- Sat 19 Sep, 2009 4:02 am
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...
- Sat 19 Sep, 2009 2:11 am
- Forum: Programming Help
- Topic: [Script] The for Loop
- Replies: 1
- Views: 9957
[Script] The for Loop
Okay, I was looking at some scripting language and I could understand everything but this bit
What does this mean? How would it look in C, C++, or Java?
Code: Select all
for i in xrange(j, 1, 1)
and
g = []
- Sat 19 Sep, 2009 2:01 am
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...
- Fri 18 Sep, 2009 8:44 pm
- Forum: Programming Help
- Topic: [Java] Nodes (Circularly Linked Lists)
- Replies: 27
- Views: 45079
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...