Search:

Type: Posts; User: dezett

Search: Search took 0.07 seconds.

  1. Re: Dictionary using Distributed Hash Table and BST Tree

    So: 1. I got it from a friend.
    2. constant 53 is: number of small letters + big letters + space.
    3. 96 is the code of "`" before "a" in the ASCII code.
    4. l is the size of the dictionary.

    I...
  2. Re: Dictionary using Distributed Hash Table and BST Tree

    I think my hash function has some issue.
    It should give me numbers 1-7 and for "g" it gives me 0.

    public static int hash(String key, int l)
    {
    int value = 0;

    for(int j =...
  3. Re: Dictionary using Distributed Hash Table and BST Tree

    That's right. So in BSTs i should just compare strings? No rehash needed?
  4. Re: Dictionary using Distributed Hash Table and BST Tree

    I need to use a Hashtable with an independent connecting which will store Binary Search Trees (words are to be stored in an lexicographical order).
  5. Re: Dictionary using Distributed Hash Table and BST Tree

    I mean: e.g. I get a word with a hashcode 1, so i save it in the BST with the number 1. If i get another word (it's different than the 1st), but it has the same hashcode, I want to save it in the BST...
  6. Re: Dictionary using Distributed Hash Table and BST Tree

    How should i rehash the words with the same hashcode? Creating another rehash method or using hash again(if hash - how?)?
  7. Re: Dictionary using Distributed Hash Table and BST Tree

    I have modified the constructor. Trying to fill the array with the instances.
    DHT(int n)
    {
    bst = new BST[n];

    for(int i = 0; i < n; i++)
    ...
  8. Re: Dictionary using Distributed Hash Table and BST Tree

    return bst[k].insert(x, k);

    variables: x, k, bst array.
    x = a
    k = n
    bst[1 - n] = null

    line 236
    public static class DHT
    {
  9. Re: Dictionary using Distributed Hash Table and BST Tree

    Well, i Can't find such a variable. Though when i was trying to debug, i found that the program has some problems with the DHT constructor. This is what it displayed: Not able to submit breakpoint...
  10. Re: Dictionary using Distributed Hash Table and BST Tree

    Exception in thread "main" java.lang.NullPointerException
    at JavaApplication18$DHT.insert(JavaApplication18.java:244)
    at JavaApplication18.main(JavaApplication18.java:18)
  11. Re: Dictionary using Distributed Hash Table and BST Tree

    The problem is clearly in the insert method of the BST/DHT class. It crashes at the beginning, while passing the variables from DHT insert to BST insert. It doesn't even print anything when I add a...
  12. Re: Dictionary using Distributed Hash Table and BST Tree

    I have corrected the code. Now it has no compiler errors.
    I have added to the code in main:
    while(!"#".equals(s))
    {
    int p = hash(s, n);
    System.out.println(s + " " + n...
  13. Re: Dictionary using Distributed Hash Table and BST Tree

    Well, I did as you told me, but it didn't tell me a thing. When I printed the variables i didn't get any null value. They were good. I did the whole function with the arguments given on the paper and...
  14. Dictionary using Distributed Hash Table and BST Tree

    Hello. I have a problem with my code.
    I have implemented BST Tree as well as DHT but my code doesn't work.
    Here it is:

    import java.util.Scanner;

    public class JavaApplication18
    {
    ...
Results 1 to 14 of 15