Search:

Type: Posts; User: javapenguin

Search: Search took 0.08 seconds.

  1. Replies
    12
    Views
    2,028

    Re: Map implementation.

    As to that, if it's already there, the method, somewhat based upon the java Map interface, returns a Value. Hence I had to return something.

    Found the problem I think

    I had

    while(temp.next...
  2. Replies
    12
    Views
    2,028

    Re: Map implementation.

    Constant time? I thought it was more like logarithmic time. If you used hashing or an AVL tree, then you'd have about logarithmic time. It would probably get a bit closer to linear with hashing,...
  3. Replies
    12
    Views
    2,028

    Re: Map implementation.

    Just wanted to write a Map class for the fun of it.

    Also, it works with a linked list. You are right. My get method won't get the middle nodes. Perhaps I should store the keys in a set class....
  4. Replies
    12
    Views
    2,028

    Re: Map implementation.

    What I'm baffled about is why my toString is only showing the first element, though my size method returns the right size and my getMethod() works fine.
  5. Replies
    12
    Views
    2,028

    Re: Map implementation.

    I tried an implementation, but it only seems to be adding the first one, and not any others.

    Why is that?




    public class MyMap<K,V>
    {
  6. Replies
    12
    Views
    2,028

    Re: Map implementation.

    Actually, a sort of LinkedList would work. It wouldn't be an internal linked list, only it would involve next and previous links. However, it wouldn't be indexed, hence the possible need for the...
  7. Replies
    12
    Views
    2,028

    Map implementation.

    While I haven't started yet, per se, I have an idea, kind of, how it might work.

    Right now, it would seem I might have to use two parallel LinkedLists, or DoublyLinkedLists, as I have made such a...
Results 1 to 7 of 7