Submit web site - 1198 Java Utilities Package and Bit Manipulation Chapter

1198 Java Utilities Package and Bit Manipulation Chapter 20 tor increases, there are fewer available slots relative to the total number of slots, so the chance of selecting an occupied slot (a collision) with a hashing operation increases. 20.3 When a program calls popor peekon an empty Stack object, an EmptyStackException occurs. 20.4 a) bitwise AND (&). b) bitwise inclusive OR (|). c) bitwise exclusive OR (^). d) mask. e) left shift operator (<<). f) right shift operator with sign extension (>>), right shift operator with zero extension (>>>). EXERCISES 20.5 Define each of the following terms in the context of hashing: a) key b) collision c) hashing transformation d) load factor e) space time trade-off f) Hashtable class g) capacity of a Hashtable 20.6 Explain briefly the operation of each of the following methods of class Vector: a) addElement b) insertElementAt c) setElementAt d) removeElement e) removeAllElements f) removeElementAt g) firstElement h) lastElement i) isEmpty j) contains k) indexOf l) trimToSize m) size n) capacity 20.7 Explain why inserting additional elements into a Vector object whose current size is less than its capacity is a relatively fast operation and why inserting additional elements into a Vector object whose current size is at capacity is a relatively slow operation. 20.8 In the text, we state that the default capacity increment of doubling the size of a Vector might seem wasteful of storage, but it is actually an efficient way for Vectors to grow quickly to be about the right size. Explain this statement. Explain the pros and cons of this doubling algorithm. What can a program do when it determines that the doubling is wasting space? 20.9 Explain the use of the Enumeration interface with objects of class Vector. 20.10 By extending class Vector, Java s designers were able to create class Stack quickly. What are the negative aspects of this use of inheritance, particularly for class Stack? 20.11 Explain briefly the operation of each of the following methods of class Hashtable: a) put b) get c) remove d) isEmpty
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Leave a Reply