Results 1 to 12 of 12

Thread: More Java questions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    zombologist Senior Member doc_bean's Avatar
    Join Date
    Oct 2004
    Location
    Riding Shai-Hulud
    Posts
    5,346

    Default Re: More Java questions

    Quote Originally Posted by Blodrast
    I don't get the idea about the Dukats. Do you need to do more than just remember one value, i.e. the sum of Dukats ? Or are you trying to say that you want to store each and every single Dukat as a distinct object - which I don't see the point of, not to mention it would be horribly inefficient, and completely non-sensical (one Dukat is identical for all purposes to any other Dukat). So why would you ever need more than one Dukat object, which stores a number (which represents how "many" Dukats the holder actually has) ?
    I asked that question too, it's horribly contrived imho, but the way it's worded it seems like they expect us to make links to individual objects. Can you make a class that can only have a single object ?

    Again, I'm not sure I get it. Do you need more than 4 bytes or such to store the Dukats ?
    (4 bytes assuming 2^^32 is enough for the amount of Dukats, of course).
    we can choose how we implement it, but he (the professor) seems to be a big fan of the non-limited numbers, such as BigInteger. It really depends on the context which we're not getting...


    For the "current big problem": I dunno, do you HAVE to come up with a unique identifier ?
    I assume you know it's okay to have collisions in hash tables...so...
    Also, the choice of the data structure that you'll use should be interesting - at a first glance, I'd say hash tables, since they're generally the most efficient ones...
    Well, we can use any strucutre we want, but they want to be able to ask for the lightest and heaviest item in real time and to add and remove items in O(log n), I think hashmaps have near O(1) so they're defiantly okay, but I need to get the weight in there somehow...

    I'm not too experienced with ahshmaps either, we've only used them once. (did I mention I wrote my first java class 10 weeks or so ago, the current structure is over 60pages already and only halfway done )

    sigh, I'm afraid that instead of help you're just getting more questions here...sorry.
    nah, I appreciate a different view on the matter
    I wish they made what they want'ed more clear though...
    Last edited by doc_bean; 05-15-2006 at 21:47.
    Yes, Iraq is peaceful. Go to sleep now. - Adrian II

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO