Click here to Skip to main content
14,544,858 members
   

Java

 
PinnedForum Guidelines - PLEASE READ PinPopular
Chris Maunder28-Jul-09 2:36
cofounderChris Maunder28-Jul-09 2:36 
Questiondiagram of gantt and java swing Pin
Member 1484673228-May-20 15:12
MemberMember 1484673228-May-20 15:12 
QuestionBuying a computer for development in Java ecosystem Pin
Member 1484653628-May-20 7:55
MemberMember 1484653628-May-20 7:55 
AnswerRe: Buying a computer for development in Java ecosystem Pin
Dave Kreskowiak28-May-20 15:54
mveDave Kreskowiak28-May-20 15:54 
Questionplz, someone should help me to debug this error my i can asses my database but my next button is not working with it it keep getting this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Employees.Workers.btnNextActio Pin
Member 1484280524-May-20 22:47
MemberMember 1484280524-May-20 22:47 
AnswerRe: plz, someone should help me to debug this error my i can asses my database but my next button is not working with it it keep getting this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Employees.Workers.btnNextA Pin
Richard MacCutchan24-May-20 22:56
mveRichard MacCutchan24-May-20 22:56 
GeneralMessage Closed Pin
25-May-20 3:26
MemberMember 1484309125-May-20 3:26 
GeneralRe: plz, someone should help me to debug this error my i can asses my database but my next button is not working with it it keep getting this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Employees.Workers.btnNextA Pin
Richard MacCutchan25-May-20 4:38
mveRichard MacCutchan25-May-20 4:38 
GeneralRe: plz, someone should help me to debug this error ... Pin
Richard Deeming27-May-20 1:08
mveRichard Deeming27-May-20 1:08 
GeneralRe: plz, someone should help me to debug this error ... Pin
Richard MacCutchan27-May-20 1:50
mveRichard MacCutchan27-May-20 1:50 
QuestionJava 1st Year Project Pin
Member 1483530117-May-20 18:12
MemberMember 1483530117-May-20 18:12 
AnswerRe: Java 1st Year Project Pin
Richard MacCutchan17-May-20 21:05
mveRichard MacCutchan17-May-20 21:05 
QuestionReturn negative number as 0 Pin
and180y17-May-20 3:38
Memberand180y17-May-20 3:38 
AnswerRe: Return negative number as 0 Pin
Richard MacCutchan17-May-20 5:38
mveRichard MacCutchan17-May-20 5:38 
GeneralRe: Return negative number as 0 Pin
and180y17-May-20 6:10
Memberand180y17-May-20 6:10 
GeneralRe: Return negative number as 0 Pin
Richard MacCutchan17-May-20 6:47
mveRichard MacCutchan17-May-20 6:47 
GeneralRe: Return negative number as 0 Pin
and180y17-May-20 6:55
Memberand180y17-May-20 6:55 
GeneralRe: Return negative number as 0 Pin
Richard MacCutchan17-May-20 21:02
mveRichard MacCutchan17-May-20 21:02 
GeneralRe: Return negative number as 0 Pin
and180y17-May-20 6:46
Memberand180y17-May-20 6:46 
GeneralRe: Return negative number as 0 Pin
Richard Deeming18-May-20 0:55
mveRichard Deeming18-May-20 0:55 
GeneralRe: Return negative number as 0 Pin
and180y18-May-20 1:44
Memberand180y18-May-20 1:44 
Questionhashing assignment Pin
Member 1483469916-May-20 20:43
MemberMember 1483469916-May-20 20:43 
AnswerRe: hashing assignment Pin
Richard MacCutchan16-May-20 21:34
mveRichard MacCutchan16-May-20 21:34 
GeneralRe: hashing assignment Pin
Member 1483469916-May-20 22:25
MemberMember 1483469916-May-20 22:25 
hi Richard,
thank you for replying. So the hash table implementation stores simple String data items, so we can only track if an item is in the data structure or not. The find function, determines if the string is in the data the hash table or not. The program loads the test dataset into the data structure, then performs find operations on all the test data items, followed by find operations on a disjoint set of unseen data items.

Iv been able to code the hash component, its just the search part that I'm not too sure of.

this is my hash function
public int hash ( String s )
   {
      int sum = 0;
      
      for(int=0, i<s.length(); i++)
      {sum +=((int)string.charAt(i))%size;}

      return sum %size;
   }  
// return True if the hash table contains string s
   // return False if the hash table does not contain string s

my find function would resembles something along these lines.
   boolean find ( String s )
   {
      boolean found = false;
      int value = hashFunction(s, size);
      
      return found;
   }


modified 17-May-20 5:15am.

GeneralRe: hashing assignment Pin
Richard MacCutchan16-May-20 23:17
mveRichard MacCutchan16-May-20 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.