I have four functions total:
I'm having problems with the last step and don't know how to set up the loops and everything to reorganize the array. Can you give me some good advice on that?
A:
Ok, first of all, your approach to the problem is great.
But your last function seems to have a difficult strategy. Try this instead:
Since the loop counts down, you should go through each run starting with the largest and ending with the smallest!
A: Yes I did. Do you feel lucky.....punk
A: Don't start a new run if the numbers are identical. Only start a run if the next number is smaller.
A: Well little buddy, let's look at Glinert's example:
The worst case would be if all the numbers were in descending order, then you would have the same amount of runs as you do numbers!
A: There are several ways to attack this problem, and many will work. Some people may feel more comfortable using a 2-D array and sticking each run into each row of the array. You could accomplish this by putting the first run in the first row, then have a "check" for when the next run starts and go to the next row. You will also need another array to hold the sizes of each run. While this will work fine, it may be tricky for people who don't know how to use nested for-loops.
Another way, would be to have 3 separate arrays.
Finally, start to write the program slowly, taking baby steps. First just get your program to put the indexes in the second array. Then, when that works fine, write another function that fills in the third array with the sizes of the runs. And then finally, after you have all three arrays filled in correctly, get the program to output the runs from biggest to smallest.
A: First of all, don't worry about your yesterday directory taking up disk space (it's all stored on a backup server).
Second, try to look for large hidden files. Do this by typing:
Also another answer is to clear the cache in Netscape. It download tons of pictures and these really build up quickly.
TA SLAUGHTERS UNDERGRAD : Bloodbath during office hours . Insane rage rumored to be sparked by a single email message - Judge's verdict: Justifiable homicide. |