Click here to Skip to main content
15,033,303 members
Home / Discussions / Java
   

Java

 
GeneralRe: Return negative number as 0 Pin
Richard MacCutchan17-May-20 21:02
mveRichard MacCutchan17-May-20 21:02 
GeneralMessage Closed Pin
5-Jul-20 21:57
Memberathenna5-Jul-20 21:57 
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 
GeneralRe: hashing assignment Pin
Member 1483469916-May-20 23:43
MemberMember 1483469916-May-20 23:43 
GeneralRe: hashing assignment Pin
Richard MacCutchan16-May-20 23:49
mveRichard MacCutchan16-May-20 23:49 
Questiondefine Netbeans launcher file properties Pin
stb200914-May-20 4:32
Memberstb200914-May-20 4:32 
AnswerRe: define Netbeans launcher file properties Pin
stb200914-May-20 18:25
Memberstb200914-May-20 18:25 
Questionاشارة المرور Pin
Member 148252407-May-20 11:24
MemberMember 148252407-May-20 11:24 
AnswerRe: اشارة المرور Pin
Dave Kreskowiak7-May-20 14:38
mveDave Kreskowiak7-May-20 14:38 
GeneralRe: اشارة المرور Pin
Eddy Vluggen7-May-20 14:49
professionalEddy Vluggen7-May-20 14:49 
GeneralRe: اشارة المرور Pin
Dave Kreskowiak7-May-20 14:53
mveDave Kreskowiak7-May-20 14:53 
AnswerRe: اشارة المرور Pin
Eddy Vluggen7-May-20 14:46
professionalEddy Vluggen7-May-20 14:46 
QuestionVB.NET Pin
Babayomi28-Apr-20 12:20
MemberBabayomi28-Apr-20 12:20 
AnswerRe: VB.NET Pin
Peter_in_278028-Apr-20 13:46
professionalPeter_in_278028-Apr-20 13:46 
GeneralMessage Closed Pin
10-May-20 23:26
MemberElen Grun10-May-20 23:26 
AnswerRe: VB.NET Pin
Richard MacCutchan28-Apr-20 21:43
mveRichard MacCutchan28-Apr-20 21:43 
AnswerRe: VB.NET Pin
ZurdoDev8-May-20 1:30
professionalZurdoDev8-May-20 1:30 
QuestionJava Pin
Babayomi26-Apr-20 4:41
MemberBabayomi26-Apr-20 4:41 
AnswerRe: Java Pin
Richard MacCutchan26-Apr-20 5:31
mveRichard MacCutchan26-Apr-20 5:31 

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.