Java Hash Tables 2

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии • 136

  • @derekbanas
    @derekbanas  11 лет назад +3

    Thank you :) I'm having a hard time deciding what to do next. I originally planned on covering topics like game engines, C, C++, the math needed, etc. Because of requests I have decided to start Android at the end of this month. Then I plan on making games in Android. I want to also make Android apps that will improve on the learning process for topics like math. I have BIG plans. I just have to work my head around completing them

  • @derekbanas
    @derekbanas  11 лет назад

    Sorry about the confusion. When I print out the hashtable, I always print 10 cells per row even if they aren't in the array actually. Does that make sense?

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) Did you try the code I provide on my site, or do you have any errors?

  • @gabem.9028
    @gabem.9028 8 лет назад +9

    Just wanted to say your videos are very well structured and to the point!!
    Great job, thanks for putting these up.

    • @derekbanas
      @derekbanas  8 лет назад +1

      +Gabe Montenegro You're very welcome :) Thank you

  • @derekbanas
    @derekbanas  11 лет назад

    I have all my java algorithm videos here on one page newthinktank. com/videos/java-algorithms/

  • @123japanuser
    @123japanuser 11 лет назад

    Γεια σας Αγαπητέ προπονητής,
    Hashtable σειρά πρόκειται να είναι φοβερό.
    Όλα χάρη σε εσάς.
    Η κατανόησή μου πήρε καλύτερα.
    Απλά ήθελα να σας ευχηθώ κάθε ευτυχία και επιτυχία.
    -----
    Παρακαλώ μετά στις 10 μ.μ. EST έτσι μπορώ να κερδίσω το χρυσό :) :) :)

  • @sagarvadalia
    @sagarvadalia 10 лет назад +1

    These videos are amazing. I have a major CS test coming up and Ive watched all your videos and I feel super prepared

    • @derekbanas
      @derekbanas  10 лет назад

      sagar vadalia Thank you :) I'm glad to hear they helped. Best of luck on your tests.

  • @derekbanas
    @derekbanas  11 лет назад +3

    My displayTheStack method always prints out boxes in multiples of 10 no matter how large the array is. You'll notice that nothing ever goes into any of the indexes higher than 60 in the video. Sorry if that caused confusion. Trust me the size of the hash table is 61 and not 69

  • @derekbanas
    @derekbanas  11 лет назад

    Why not use regular expressions for that?

  • @anilkurmi5966
    @anilkurmi5966 11 лет назад

    It's great thought , Yes programming is like practical mathematical tool to come up creativity and test our knowledge. When you do things in programming it also leave us blue print of that which other people can use.

  • @EFT202020
    @EFT202020 11 лет назад

    This is really interesting stuff. Not just from a programmers point of view.

  • @derekbanas
    @derekbanas  11 лет назад

    I always enjoyed learning about how to solve problems. I grew up without a tv and idolized Sherlock Holmes. I wanted to be just like him. Programming became the thing I wanted to be good at like he wanted to be the best at solving crimes. I think the problem is that people give up on their dreams too early because they aren't achieving them quick enough. I think we can all do most anything if we are willing to keep on learning a little more every day :)

  • @derekbanas
    @derekbanas  11 лет назад

    A hashtable doesn't work very well in situations in which you have duplicates. If you base each words key off of the number of times it appears in a sentence that will cause many problems. It sounds like a different data structure is needed. Why are you trying to use a hashtable?

  • @rajamartanda
    @rajamartanda 11 лет назад +1

    Hi , just a doubt, i have understood your tutorials, but what is my default hashtable going to do , why do we do all the stuff that is implemented by hashtable itself ? because i dont see you using Hashtable class, can you please clarify ..

  • @igorpetrovski9033
    @igorpetrovski9033 11 лет назад +1

    Derek, you have a mistake in the isPrime function. First you need to check whether number == 2 and return true if it equals 2. In the function you wrote if number equals 2 it will return false, which is not correct. I know that it is a very special case, but I think that it should be considered.
    Great tutorial.
    Cheers!

  • @derekbanas
    @derekbanas  11 лет назад

    You're very welcome :) I have a tutorial on Big O notations that should help with that here ruclips.net/video/V6mKVRU1evU/видео.html

  • @earthwombat
    @earthwombat 7 лет назад

    hey Derek, I have a question about the data type in used. For C, I implement a trie before using array of structs, I think hashtables could be done similarly. How do I choose between using array or structs? Could you do the same thing using structs in java?

  • @NickTunac
    @NickTunac 11 лет назад

    Hi Derek thank you for this tutorial. Hmm I would like to quote this " I think the problem is that people give up on their dreams too early because they aren't achieving them quick enough. I think we can all do most anything if we are willing to keep on learning a little more every day"

  • @sergeplourde6761
    @sergeplourde6761 10 лет назад

    Hi Derek, thanks for the excellent work you are doing with your tutorials.
    I think I spotted three errors though.
    1. theFunc.hashFunction2(elementsToAdd2, theFunc.theArray); should be called with first parameter being elementsToAdd3, shouldn't it?
    Errors regarding prime number calculation:
    "A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself." - Wiki
    So 1 is not a prime number, but 2 is a prime number. Any negative number is not a prime.
    2. integer 2 is a prime number, so the function isPrime that currently starts with:
    if (number % 2 == 0)
    return false;
    should be corrected (imho) to something like this:
    if (number < 2) return false;
    if (number == 2) return true;
    if (number % 2 == 0)
    return false;

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you for pointing that out. I think I fixed the code on my site after I noticed the typo. I'm mobile right now so I'll check later to make sure.

  • @derekbanas
    @derekbanas  11 лет назад

    This tutorial should really be called How All those Tools you Use Actually Work :)

  • @darriuswright27
    @darriuswright27 11 лет назад

    Hi Derek I just want to start by saying that I love your videos; though i do have a question for you are you going to ever get into game engine development because I think that would be a great series.

  • @derekbanas
    @derekbanas  11 лет назад

    Yes I use arraylists all of the time in my Java tutorials. I also have a tutorial on them in my java video tutorial for part 11

  • @derekbanas
    @derekbanas  11 лет назад

    Stick with it and it will make sense. I hope to eventually cover math topics, but I want to do it the right way. I want it to be fun and interesting. If I could make math tutorials that really helped people, that would be awesome!

  • @architjain7833
    @architjain7833 9 лет назад

    Hey Derek..Videos for algo are awesome. These are fast and precise.
    Just wanted to know if you have uploaded videos on Java Collections too?

    • @derekbanas
      @derekbanas  9 лет назад

      +Archit Jain Thank you :) I don't have videos that are specific to the Java collections but I use them in my Java and Android tutorials

  • @lucasf7084
    @lucasf7084 11 лет назад

    Your video is great! It helps me a lot!
    Though I have a question here. So 61 is the next prime number after 60. Why the array have a size of 69? I saw this at 11:23 in the video

  • @tomnnguyen4845
    @tomnnguyen4845 8 лет назад

    U helped me complete my assignment about hash table! Thank you so much! Keep going well! :)

    • @derekbanas
      @derekbanas  8 лет назад

      +Tomn Nguyen You're very welcome :)

  • @samtux762
    @samtux762 8 лет назад

    Thank you for a great tutorial! I think you should have increased the value of the step. golden ratio (some step=37 and hash table size =61) might be the best because golden ratio has the worst chain fraction approximation and the lowest likelihood of collision.

  • @jianchengwu6466
    @jianchengwu6466 9 лет назад

    for the programming up until 11.05, when I type prime number in increseArraySize(), it will throw arrayOutBound Exception. It works for non prime number because it will increase the size to next prime. But when I use prime number(assume is 67) for the new array size, it will get exception. I tried to fix this, but I failed. Derek, need help to explain why this will happen.

  • @mjbgworld5594
    @mjbgworld5594 10 лет назад +1

    Hi Derek! I find your tutorials very useful. I just want to ask how to implement a quadratic probing method. I noticed that you used linear probing for hashFunction2 method. I appreciate any help or suggestion. Thanks

    • @biniyamasnake9756
      @biniyamasnake9756 6 лет назад

      I believe instead of incrementing by 1 each time, you should increment by the number of rehash attempts squared. I would create variable that keeps track of every collision, and then instead of adding one to the arrayIndex add number of collisions squared. Hope this helps

  • @derekbanas
    @derekbanas  11 лет назад

    Android development starts next week. I had a vote a while back on whether people wanted to see web or tablet development. Tablets won, so that is why I've been focusing on that path. I really just want to teach about game development because it requires so many other skills. I'll get to everything else ASAP

  • @stevenshrii
    @stevenshrii 2 года назад

    In your r moveEmptyspacesInArray(String arrayToClean) the ‘if’ statement should that be an or || not an and && ?

  • @derekbanas
    @derekbanas  11 лет назад +1

    Thank you :) I just used 69 so that there would be an equal number of spaces in the columns that are displayed on the screen.

  • @anubhavanubhav7651
    @anubhavanubhav7651 8 лет назад

    Hi,
    The function you used to generate a step distance
    int stepDistance = 7 - (Integer.parseInt(newElementVal) % 7);
    Can you use a random function "RAND" to generate random index.
    Will that solve the clustering problem.
    Please suggest..?
    Thanks

    • @johnmaynard3463
      @johnmaynard3463 8 лет назад +1

      it would solve the clustering, but you would no longer be able to find the target using a key.

    • @anubhavanubhav7651
      @anubhavanubhav7651 8 лет назад

      Ok...thanks John...I got it.
      As every time it will generate a new number and same will not be mapped backwards..isn't it

    • @xarcaz
      @xarcaz 7 лет назад

      False. Pseudorandom number generators can be seeded and their emulated stochasticity can therefore be accessed in a deterministic fashion. Id est:
      rng.setSeed( hash1 ); // where rng = class member Random; ensures that the second line is deterministic
      int hash2 = rng.nextInt( arraySize ); // produces a second "random" hash within the range [0, arraySize)

  • @soyeonpark779
    @soyeonpark779 9 лет назад +14

    You da real MVP

    • @derekbanas
      @derekbanas  9 лет назад +2

      Soyeon Park That's funny :) Thank you

    • @faruzzy
      @faruzzy 8 лет назад +1

      +Soyeon Park (Shannon) +Derek where P stands for Programmer ;)

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :)

  • @yuanfinn2833
    @yuanfinn2833 6 лет назад

    Very helpful! but just do not know what the double hash exactly means... Would you please answer me?

  • @derekbanas
    @derekbanas  11 лет назад

    I make everything 100% on my own. It isn't really that hard. The hardest part is to make them understandable. Once I figure out how to do that I draw a sequence diagram and crank out the code

  • @AzMahgs
    @AzMahgs 6 лет назад

    you're wonderful. Thank you so much for this professional videos

    • @derekbanas
      @derekbanas  6 лет назад

      Thank you very much :) I'm happy they helped

  • @KartheekAchanta
    @KartheekAchanta 9 лет назад

    WHere is the concept of key value pairs in these videos ?, I am feeling confused how the login you implemented is different from HashTable class in Java ?

  • @gt5112alange
    @gt5112alange 10 лет назад +1

    Hey Derek,
    Firstly thanks for all your tutorial videos, they are pretty helpful.
    I was thinking of the example you used to explain why we use a prime number for the arraySize.
    Since "30", "60", "90", "120", "150", "180" these numbers are intentionally chosen and they are multiples of 30(which is the arraySize), so there will be a lot of collisions while storing.
    Then you mentioned if we change the arraySize to 31, the modulus for those numbers will be different, so a lot of collisions will be avoided.
    HOWEVER, what if the numbers added into hash table are "31", "62", "93", "124", "154", "185", which are multiples of 31? then I guess the same collisions will happen as well, no matter if 31 is a prime number or not.
    Thanks!
    Rich

    • @user-eo5bh2zg2
      @user-eo5bh2zg2 6 лет назад

      He said that patterns similar to the one you just described are not as common as the one he used in the example. Nothing is perfect, just less bad

  • @redvel5042
    @redvel5042 7 лет назад +2

    When checking if a number is prime or not, a nice way to make things quicker is to check until the square root of the number, instead of until the number itself.

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you for pointing that out :)

  • @yevgeniyv.87
    @yevgeniyv.87 6 лет назад

    It should be noted that your displayStack() method isnt the same as it was in Video 1, took a while to figure out why my hashtable kept printing out differently than yours.

  • @xarcaz
    @xarcaz 7 лет назад

    For the double hash, why not use the first hash as a parameter to a seeded number generator? Something along the lines of: rng.setSeed( hash1 ); int hash2 = rng.nextInt( arraySize ); // where rng = Random rng

  • @issa159357
    @issa159357 11 лет назад

    hey derek
    thanks for ur reply i wana ask u about if i have a code how i can calculate his time complixty ,, ?
    THANKS AGAIN

  • @derekbanas
    @derekbanas  11 лет назад

    I have an additional hash table tutorial after this. It should help

  • @gauravgupta4543
    @gauravgupta4543 10 лет назад

    I would like to thank you for such a helpful video.

    • @derekbanas
      @derekbanas  10 лет назад

      Gaurav Gupta You're very welcome :)

    • @gauravgupta4543
      @gauravgupta4543 10 лет назад

      Derek Banas I watched your all videos on Linked List, Binary tree and it helped me to learn concepts completely. In case I have any problem with any other concept, Is there anyway (like email) to contact you?

  • @sirishadudiki
    @sirishadudiki 10 лет назад +5

    with array size 31, we get collision again if we array of elements 31,62, 93.....

    • @MadJDMTurboBoost
      @MadJDMTurboBoost 6 лет назад

      He clearly stated that patterns in real life data sets don't generally happen in primes. You are more likely to get numbers like 30,60,90 than 31,62,93. Furthermore, you should be looking at your dataset and basing your algorithm on that. In this case a higher prime would be better, but if all your numbers are like under 30, then it would make no sense to use 31.

  • @mohanliu4156
    @mohanliu4156 11 лет назад

    but still I appreciate your effort on making this fantastic video, Keep it up : )

  • @Truthiness231
    @Truthiness231 11 лет назад

    Very informative and it's good to know how a hashtable works, but I'm going to stick to .Net's generic solutions + overriding hashCode as opposed to making my own. This was complicated enough, after adding on thread safety it would be a monster (er, well, at least in comparison to the objects I've been making lately; since I watched your refactoring series and started making smaller more specific objects). I really can't go back to large classes now that I've tasted the freedom of granularity.

  • @saffriya
    @saffriya 11 лет назад

    i am making a project on auto summarization tool.
    so i am using stammer and lemma, to reduce the no and length of words in a given sentence .
    i only need to place them in a hash table according to there frequency (frequency= how many times a word is repeating in a whole input)
    so ,i am taking frequency of word as a key value
    and thts what i am not able to do it
    i need help in this

  • @jose123jj
    @jose123jj 11 лет назад

    Hey Derek, Awesome tutorial. Couple of things though, any reason why you decided to use an ArrayList instead of doubling the size of the array? And you could use System.arraycopy method to do a lot of the work for you. Awesome tutorial anyways.

  • @LydiaChen1
    @LydiaChen1 10 лет назад +3

    How about 2, 2 is prime number. if U number %2 ==0 then U exclude prime numbe 2.

    • @pasangsherpa4638
      @pasangsherpa4638 5 лет назад

      are you a troll? anyway if not, this is because the prime number check is being done to find the next possible arraysize that is prime number. now if you were to get 2 as your next possible arraysize that means the size of the prvevious array was 1 which is highly unlikely. even if the size of previous array was 1 then the arraysize being used would be 3. so you only skip 2 which should not make that much of a difference.

  • @mohanliu4156
    @mohanliu4156 11 лет назад

    Hey, I am not sure if your isPrime function actually works ? ?
    Since I watched it at 11:14 that your hash table actually has 69 boxes and that is not a prime.

  • @derekbanas
    @derekbanas  11 лет назад

    Sie sind herzlich willkommen

  • @caioferreira3308
    @caioferreira3308 4 года назад

    does windows defragmenter use this algorithm?

  • @TheDebare
    @TheDebare 11 лет назад

    @Derek , you might have already made this video but I could not find it. A video about Hashmaps or Hashmaps vs Hashtables

  • @issa159357
    @issa159357 11 лет назад

    hey derek..
    i have a project that i want to accses files using hashing then find the exactly id of someone on that file how i can make this ,, :)

  • @derekbanas
    @derekbanas  11 лет назад

    Με τη διδασκαλία γι 'αυτούς ήμουν σε θέση να καλύψει ένα σωρό άλλα πράγματα. Έχει ένα ενδιαφέρον θέμα. Χαίρομαι που σας αρέσει. Θα δω αν μπορώ να δημοσιεύσετε στο 10. Βοηθός μου έχει φύγει τώρα, ώστε να μπορεί να είναι πιο δύσκολο να δημοσιεύσετε βίντεο γρήγορα

  • @_avenger9709
    @_avenger9709 7 лет назад

    How does the line in arrayIndex %= arraySize not cause an infinite loop?

  • @kevinkastrowiak
    @kevinkastrowiak 11 лет назад

    well done fella ! !

  • @abifoluwaoni1966
    @abifoluwaoni1966 10 лет назад

    can i use a hashtable to store the data that i get from an XML file?

  • @sgball3709
    @sgball3709 9 лет назад

    Nice video. thanks

  • @alankaradas
    @alankaradas 11 лет назад

    Excellent as always. Thanks for sharing. :)

  • @verdyrizaldi790
    @verdyrizaldi790 8 лет назад

    can you explain why do you multiply i by 2 in the for loop in isPrime method?

    • @derekbanas
      @derekbanas  8 лет назад

      +Verdy Rizaldi Its math stuff. number % 2 == 0 eliminates all even numbers. Then we only have to go up to the square root of number because when you list out all of the factors of the number the square root will always be in the middle.

    • @verdyrizaldi790
      @verdyrizaldi790 8 лет назад

      I actually figured it out a few minutes ago, but thx for ur response :D

    • @derekbanas
      @derekbanas  8 лет назад

      +Verdy Rizaldi No problem :)

    • @vivilee7290
      @vivilee7290 7 лет назад

      But, 2 is also a prime number, isn't it?

  • @arielsnir
    @arielsnir 10 лет назад

    You are really good!!

  • @hippiestafarii
    @hippiestafarii 3 года назад

    Here in 2021 ; thanks bro :-)

    • @derekbanas
      @derekbanas  3 года назад +1

      It is my pleasure to help :)

  • @sergeplourde6761
    @sergeplourde6761 10 лет назад +3

    Another little bug found in isPrime() method. I did a unit testing which resulted in:
    Next prime to -1 is 2
    Next prime to -2 is 2
    Next prime to -3 is 2
    Next prime to -4 is 2
    Next prime to 0 is 2
    Next prime to 1 is 2
    Process finished with exit code -1
    Next prime to 2 is 2
    junit.framework.AssertionFailedError: Next prime expected for 2 is 3 expected: but was:
    at numbers.PrimaryNumbersTest.testGetNextPrime(PrimaryNumbersTest.java:77)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:141)
    at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
    One way to fix it is to insert:
    if (isPrime(minNumberToCheck)){
    minNumberToCheck++;
    }
    at the beginning of the method. Then for my unit test data:
    Next prime to -1 is 2
    Next prime to -2 is 2
    Next prime to -3 is 2
    Next prime to -4 is 2
    Next prime to 0 is 2
    Next prime to 1 is 2
    Next prime to 2 is 3
    Next prime to 3 is 5
    Next prime to 4 is 5
    Next prime to 5 is 7
    Next prime to 6 is 7
    Next prime to 7 is 11
    Next prime to 8 is 11
    Next prime to 9 is 11
    Next prime to 10 is 11
    Next prime to 11 is 13
    Next prime to 12 is 13
    Next prime to 13 is 17
    Next prime to 14 is 17
    Next prime to 15 is 17
    Next prime to 16 is 17
    Next prime to 17 is 19
    Next prime to 18 is 19
    Next prime to 19 is 23
    Next prime to 20 is 23
    Next prime to 21 is 23
    Next prime to 22 is 23
    Next prime to 23 is 29
    Next prime to 24 is 29
    Next prime to 25 is 29
    Next prime to 26 is 29
    Next prime to 27 is 29
    Next prime to 28 is 29
    Next prime to 29 is 31
    Next prime to 30 is 31

  • @Dwika34
    @Dwika34 3 года назад

    Wait why does the Double Hashing method doesn't work?

  • @spacepod100
    @spacepod100 9 лет назад

    can someone explain the isPrime method and why i*i was put in the for loop please. 5:30

    • @stevec8246
      @stevec8246 9 лет назад +1

      +spacepod100 You do not need to check for numbers that are greater than half the value of your target.

    • @stevec8246
      @stevec8246 9 лет назад

      +spacepod100 Furthermore, you do not need to check for numbers larger than sqrt(n) where n is the target value. Solving for i in the equation, sqrt(n) = i, we find that i^2 should be less than n.

  • @enesozipek1315
    @enesozipek1315 10 лет назад +1

    Everything you did is very helpful to me but could you please try to talk a little slowier :)

    • @derekbanas
      @derekbanas  10 лет назад

      Sorry about the speed. I'm working on that

  • @archiliusfowl3701
    @archiliusfowl3701 11 лет назад +5

    Hey, Derek! You play Minecraft???? Nice. (I saw that in the bottom of your screen)
    BTW Thanks a lot. I am a fan of yours. :)

    • @derekbanas
      @derekbanas  11 лет назад +2

      Hi, Yes I used to make mods for Minecraft. It is very fun to play with. I'm very happy that you enjoyed the video.

  • @JackBauerDev
    @JackBauerDev 7 лет назад

    Why not make an clean array of size itemsInArray. instead of wasting time with a arrayList which you have to convert back to an array? And again, this search function won't work if the table is full.

  • @coolbigcats94
    @coolbigcats94 9 лет назад +1

    Yo dude love your course you should be on lynda or something but quick q is there a hash table class in the java API

    • @derekbanas
      @derekbanas  9 лет назад +1

      sameer pabreja Thank you for the compliment :) I think this is what you need docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html

    • @coolbigcats94
      @coolbigcats94 9 лет назад

      Awesome

    • @coolbigcats94
      @coolbigcats94 9 лет назад

      Oh i have used this before

  • @SnoopyDoofie
    @SnoopyDoofie 9 лет назад

    When you say "clustering is not good", you need to explain why. We shouldn't be told to avoid something in programming just because someone tells us to. The reason may not be that apparent to some. Whenever developers write code, they should know exactly why something is being written. One thing I hate when reviewing someone else's code is seeing a comment like "This could be bad, so to avoid this, the following line of code fixes it" without writing why something was bad.

    • @TheCemtube
      @TheCemtube 9 лет назад

      I thought about the same "why clustring bad" and a quick google search to contribute to Derek's great work, it seems like a performance concern:
      en.wikipedia.org/wiki/Primary_clustering
      "These long chains degrade the hash-table performance closer to O(n) performance instead of closer to O(1)."

  • @mohanliu4156
    @mohanliu4156 11 лет назад

    GOOD!

  • @piyush_ramnani
    @piyush_ramnani 9 лет назад

    Your videos are really very helpful :)
    But PLEASE PLEASE try and go a little slower.

    • @derekbanas
      @derekbanas  9 лет назад

      Piyush Ramnani Thank you :) Sorry about the speed.

    • @catalinp86
      @catalinp86 9 лет назад

      Lol... I was watching it at 1.25x, hahaha

    • @brianolsen87
      @brianolsen87 8 лет назад +2

      +Piyush Ramnani RUclips has a pause button lol.

    • @kineticjohn9989
      @kineticjohn9989 6 лет назад

      Here's a tip the works for me: YMMV... get the code and explore it in the debugger before you watch the video

  • @Thegamemakur
    @Thegamemakur 11 лет назад

    Danke

  • @sagarvadalia
    @sagarvadalia 10 лет назад +1

    I love you

    • @rolarola5915
      @rolarola5915 6 лет назад

      hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

  • @joshwidman5731
    @joshwidman5731 9 лет назад

    I enjoy your videos but it would be better if you did not name fields and variables with the word new in them

    • @derekbanas
      @derekbanas  9 лет назад

      josh widman Thank you :) Sorry about that. I tend to write these out of my head so they aren't optimized.

  • @ThatBoyDunn19
    @ThatBoyDunn19 8 лет назад +1

    I'm so baffled rn. You have made 3 tutorials named "Hash Table" but NOT ONCE do you ever declare a Hashtable in java and use the predefined package provided by java. Yes I understand that a hash table is a bunch of arrays but you are still confusing the heck outta me bro. Is there a reason you don't actually DECLARE a table? Because for my school project, we have to define a hastable and its size, then add a dictionary and spell checker to it. Then a GUI. good luck to me

    • @derekbanas
      @derekbanas  8 лет назад +3

      Sorry for the confusion. I'm making hash tables from scratch.

    • @ThatBoyDunn19
      @ThatBoyDunn19 8 лет назад

      +Derek Banas No problem, thanks for replying quickly. Do you have any recommendations for setting up a dictionary using a text document and using the hash table as a spell checker? Would you want to utilize two hash tables? Or just one and compare each word using hash functions. Our teacher isn't letting us use the "hash code" function, we have to do the math

    • @DanFletcher90
      @DanFletcher90 8 лет назад

      +ThatBoyDunn If you are allowed to use the Java Collection Framework, try adding each word from your dictionary file to a HashSet. Then the text file that you want to spellcheck should be stored in another Set depending on your needs. I had a similar assignment where we didn't need a GUI, and we were to display each misspelled word in alphabetical order, so I stored the words in a TreeSet, that way they were in order. I also kept another Set to keep track of misspelled words, since we were not to show the same word twice. Again it'll depend on your specific assignment if you need that or not.
      There shouldn't be any need for custom hash functions if your supposed predefined packages. Just use the methods available with the collections you choose. But I would definitely use two collections. You're going to need to iterate through both and multiple times. I'm assuming you probably need to list possible corrections too? So you're likely going to be manipulating the incorrect words to find matches in your dictionary. This means you will be constantly searching for each manipulated string in your dictionary.
      Hope that kind of makes sense, and it's not too late for you. Good luck.

    • @ThatBoyDunn19
      @ThatBoyDunn19 8 лет назад +1

      thanks for your input, we actually had completed the project before your comment, but that's okay, we actually asked one of our lab TA's who was a CSE from India and he gladly helped us with our project, thank the lord lol

    • @alibirra1132
      @alibirra1132 8 лет назад

      where do you go to school? i had the same project

  • @patrickmcfadden4592
    @patrickmcfadden4592 7 лет назад +1

    but 2 is a prime number :O

    • @ukas150
      @ukas150 6 лет назад +1

      yes, but do you need a hash function for a hash table of size 2? hmmm

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :)