Package lec09.glab.structs

Examples of lec09.glab.structs.ListNode


   
    int nHash = obj.hashCode();
    nHash = Math.abs(nHash);
    nHash = nHash % nodVals.length;
   
    ListNode nodCurrent = nodVals[nHash];
    //nCount++;
    while(nodCurrent != null){
      nCount++;
      if(nodCurrent.getValue().equals(obj)){
        strR += obj + " found at " + nHash + " : ";
        break;
      }
     
      nodCurrent = nodCurrent.getNext();
    }
   
    strR +=  nCount + " iterations.";
    return strR;
   
View Full Code Here


    int nHash = obj.hashCode();
    nHash = Math.abs(nHash);
    nHash = nHash % nodVals.length;
   
    ListNode nodCurrent = nodVals[nHash];

    if(nodCurrent == null){
      nodVals[nHash] = new ListNode(obj, null);
    }
    else {
     
      while(nodCurrent.getNext() != null)
        nodCurrent = nodCurrent.getNext();
 
      nodCurrent.setNext(new ListNode(obj, null));
    }

  }
View Full Code Here

TOP

Related Classes of lec09.glab.structs.ListNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.