Jump to content

Baddox

Active Members
  • Posts

    33
  • Joined

  • Last visited

Contact Methods

  • MSN
    cptshaddox@hotmail.com
  • ICQ
    0

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Baddox's Achievements

Newbie

Newbie (1/14)

  1. public static int jumpIt(int[] a, int counter) { int score = 0; if (counter == a.length - 1 || counter == a.length-2 || counter==a.length-3) { cost += a[a.length-1]; return score; } else { return score + Math.min(jumpIt(a, counter + 1), jumpIt(a, counter + 2)); } } This is my current code, which is obviously not right, because it just returns the last number in each array. It is however, obviously reaching the else statement multiple times before getting to the if part. I'm just getting lost in the way the recursion is operating, obviously I'm never adding to the cost variable.
  2. I believe daemonSiege's solution is correct. I haven't quite coded it all yet, but in pseudo-pseudo code, it's roughly this: if (counter == a.length - 1 || counter == a.length - 2 || counter == a.length - 3) { return score + last item in array; } else { return score + Math.min(jumpIt(a, counter + 1), jumpIt(a, counter + 2)); } The if part handles the last 3 items in the array. The else opens up two recursive executions (which of course in turn potentially open up two more recursive executions). Score is just the integer variable keeping track of the sum. I haven't worked enough on it yet, because right now my code is iterating through all the recursions, but isn't totalling the sum, it's just returning the last number from the array. If anyone can explain how to get the sum working I would appreciate it.
  3. My Java2 class is usually a breeze and often even a joke, but for some reason I am having trouble this week with what should be a simple algorithm. What we're doing is taking a list (an array actually) of integers and determining a minimum score for "jumping" through the numbers. The first (left-most) number is always 0, and we must move to the last (right-most) number by either moving one number to the right, or "jumping" over one number and landing two numbers to the right. Any number we land on gets added to the score. When we land on the last number, it gets added as well. Our algorithm must, given the array of numbers, return the best (minimum) possible score. For example, given the numbers: 0 3 80 6 57 10 , the best solution is 19, because we land on the underlined numbers: 0 3 80 6 57 10 . This one's easy to figure out just by looking at it, but for larger lists I'm having trouble finding an algorithm. I don't need help with any of the coding, just the algorithm itself to solve the puzzle. The instructor provided some other lists with the solutions given to help test our code: 0 98 7 44 25 3 5 85 46 4 answer is 87 0 57 59 83 9 42 70 answer is 138 0 20 49 96 53 7 43 77 answer is 186 0 24 17 15 61 49 61 8 65 43 26 99 7 57 97 50 93 6 82 52 answer is 330
  4. I've got an old Treo 650, that has finally been replaced by my new HTC Fuze (AT&T's version of the Touch Pro). It's not in the best of shape, missing some case screws, and one of the SIM slot pins is bent, meaning it's pretty finicky as an actual phone. However, I'm sure someone out there has an idea for some interesting hack or mod I could do with this Treo, perhaps utilizing its bluetooth connection or something of the sort. All ideas welcome.
  5. Yeah, that's really the only elegant solution. I'll probably just have to wait for some affordable 1.5 TB drives, since all but 3 of my drives are 750 gig already (2 500 gig and 1 74 gig Raptor).
  6. Easy bro, just saying, not only is my motherboard full, but my existing case already has some spare 5.25" bays, so a new case doesn't fix anything.
  7. They're 5.25 inch bays, which, unless that particular case comes with the hardware, would require something like this http://shopping.msn.com/prices/startech-co...age-bay-adapter . I'm looking at sata controllers, but not seem to have more than 2 ports.
  8. It looks like the Antec 1200 just has tons of 5.25 drive bays, which doesn't help for hard drives. My case is nearly that big anyway, plus, the point is, my motherboard only has 6 SATA slots, and I don't know if any other mobos have more than that.
  9. Getting a bigger case won't help anything, since I'm using all my mobo's sata slots. Also, my case is this, http://www.newegg.com/Product/Product.aspx...N82E16811133011 pretty huge (and a great case by the way). I like the idea of getting a small case and doing the usb hub thing, but the cost and performance hit would be unfortunate. I might just try to get my hands on some old computer to use as a file server, that's probably the easiest and cheapest way.
  10. I have 7 hard drives in my main machine right now, and it's causing some problems with heat. The drives are packed close together right behind the intake fan, and you can really feel the heat coming off of them. I'm worried about the heat effecting the drives, not to mention heating up the rest of my computer. (I plan to purchase a new GPU soon which will further increase the heat of my machine, so I'm looking for an external SATA hard drive solution.) Obviously there exist external USB/eSATA enclosures, but they only accept one drive per. Ideally I would like some sort of rack/enclosure that can hold at least 2 drives. I know there are NAS's like the drobo, but they're expensive, and I really don't need RAID or any such thing. I think I've also seen some enclosures that hold ~3 drives and occupy a 5.25" bay or two--those would at least move some drives out from behind the intake fan. Thanks for your recommendations.
  11. Thanks. Good advice from everyone. I assume to achieve this goal I could start by spending less time on this forum. I'll try it for a while and get back to you all with the results.
  12. Hey everyone. I'm planning a trip from Missouri (where I live) to South Carolina. The trip will send me through St. Louis (obviously), Nashville, and Knoxville. I'm looking for ideas of stuff to do along the way (or out of the way even), geeky or otherwise.
  13. Even if the laptop card is something standard like AGP or PCI Express (most are), not only will the physical connection be incompatible, I wouldn't be surprised if there's soft/firm protection in the card to prevent it from being used in a normal desktop. I know with my Dell Inspiron 9300, there was talk that the BIOS'es on the video cards that would prevent them from even being used on different models of the same product line (however, I never confirmed this). If it's feasible to pull off this hack, I would only do it if I wanted something to be proud of. There's no way it's time- or money-efficient to do this hack for actually using it. It'd probably be cheaper in the end to either fix your laptop or buy a new video card and/or monitor.
×
×
  • Create New...