• Verkeerd document? Gratis ruilen
  • Geschreven door studenten die geslaagd zijn
  • Direct beschikbaar na je betaling
  • Online lezen of als PDF
Verkopen
Kies je studieland
Kies je taal
Document preview thumbnail
Voorbeeld 1 van de 3 pagina's
Tentamen (uitwerkingen)

Data Structures and Algorithms in Java Chapter 11- Hash Tables Test Bank Solution Manual Already Passed

Document preview thumbnail
Voorbeeld 1 van de 3 pagina's

Data Structures and Algorithms in Java Chapter 11- Hash Tables Test Bank Solution Manual Already Passed What is a hash table? - Answers A data structure that offers very fast insertion and searching. How quick is a hash table? - Answers Insertion and searching taks close to constant time, 0(1) making it essentially instantaneous. What are the advantages to using a hash table? - Answers They are fast and relatively easy to program. If you don't need to visit items in a specific order, and you can predict the size of your data base they are unparalleled in speed and convenience. What are the disadvantages to using a hash table? - Answers They are based on arrays which are difficult to expand after they've been created. For some kinds of hash tables performance may degrade when a table becomes too full, so the programmer should have an fairly accurate idea of how many data items will need to be stored( or be prepared to periodically transfer data to a larger hash table which is time consuming). There is no convenient way to visit items in a hash table in any kind of order(s/a smallest to largest) What is a symbol table? - Answers A symbol table is a data structure that associates a value with a key. It It supports two primary operations: insert (put) a new pair into the table and search for (get) the value associated with a given key. The symbol table holds all the variable and function names made up by the programmer, along with the address where they can be found in memory. What is the ASCII code? - Answers Its a way to represent individual characters as numbers. a is 97, b is 98, c is 99 and so on. It runs from 0 to 255 to accomodate capitals and punctuation. In an ordinary multi-digit number, each digit-position represents a value: - Answers 10 times as big as the position to it;s right. So 1234 really means 1*1000 + 2*100 + 3*10 + 4*1. ( OR writing the multipliers as powers of 10 1*10^3 + 2*10^2 + 3*10^1 + 4*10^0 How would you convert the word "money" into a multi-digit number? - Answers 1. Convert each digit into a number. I can use my own code instead of ASCII. So I would set a=1, b=2 and so on. I would set blank = 0 to accomodate for for a space giving my 27 characters. 2. Next I would multiply wach number by the appropriate power of 27 and add the results. This process generates a unique number for every potential word. An array can handle a number/word this small. What is the % operator in java? - Answers The modulo operator finds the remainder when one number is divided by another. What is a hash function? - Answers It hashes (converts) a number in a large range into a number in a smaller range. The smaller range corresponds to the index numbers in an array. What is a hash table? - Answers An array into which data is inserted using a hash function. How does a hash function work? - Answers 1. We convert a word into a huge number by multiplying each character in the word by an appropriate power of 27 and set it equal to hudgeNumber 2. Using the modulo operator (%), we squeeze the resulting huge range of numbers into a range about twice as big

Voorbeeld van de inhoud

Data Structures and Algorithms in Java Chapter 11- Hash Tables Test Bank Solution Manual Already
Passed

What is a hash table? - Answers A data structure that offers very fast insertion and searching.

How quick is a hash table? - Answers Insertion and searching taks close to constant time, 0(1) making it
essentially instantaneous.

What are the advantages to using a hash table? - Answers They are fast and relatively easy to program.
If you don't need to visit items in a specific order, and you can predict the size of your data base they are
unparalleled in speed and convenience.

What are the disadvantages to using a hash table? - Answers They are based on arrays which are difficult
to expand after they've been created. For some kinds of hash tables performance may degrade when a
table becomes too full, so the programmer should have an fairly accurate idea of how many data items
will need to be stored( or be prepared to periodically transfer data to a larger hash table which is time
consuming). There is no convenient way to visit items in a hash table in any kind of order(s/a smallest to
largest)

What is a symbol table? - Answers A symbol table is a data structure that associates a value with a key. It
It supports two primary operations: insert (put) a new pair into the table and search for (get) the value
associated with a given key. The symbol table holds all the variable and function names made up by the
programmer, along with the address where they can be found in memory.

What is the ASCII code? - Answers Its a way to represent individual characters as numbers. a is 97, b is
98, c is 99 and so on. It runs from 0 to 255 to accomodate capitals and punctuation.

In an ordinary multi-digit number, each digit-position represents a value: - Answers 10 times as big as
the position to it;s right. So 1234 really means 1*1000 + 2*100 + 3*10 + 4*1. ( OR writing the multipliers
as powers of 10 1*10^3 + 2*10^2 + 3*10^1 + 4*10^0

How would you convert the word "money" into a multi-digit number? - Answers 1. Convert each digit
into a number. I can use my own code instead of ASCII. So I would set a=1, b=2 and so on. I would set
blank = 0 to accomodate for for a space giving my 27 characters.

2. Next I would multiply wach number by the appropriate power of 27 and add the results.

This process generates a unique number for every potential word. An array can handle a number/word
this small.

What is the % operator in java? - Answers The modulo operator finds the remainder when one number
is divided by another.

What is a hash function? - Answers It hashes (converts) a number in a large range into a number in a
smaller range. The smaller range corresponds to the index numbers in an array.

Documentinformatie

Geüpload op
14 november 2024
Aantal pagina's
3
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$8.79

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
TutorJosh
3.5
(77)
Verkocht
508
Volgers
16
Items
33081
Laatst verkocht
3 dagen geleden




Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen