DSAJ5 Test-Bank-Chapter 20.docx - Chapter 20 Dictionaries True\/False(17 1 In the ADT dictionary search keys and values are paired Answer true 2 The ADT

DSAJ5 Test-Bank-Chapter 20.docx - Chapter 20 Dictionaries...

This preview shows page 1 - 3 out of 7 pages.

Chapter 20 - Dictionaries True/False (17) 1.In the ADT dictionary, search keys and values are paired. 2.The ADT dictionary organizes and identifies its entries by position. 3.Every entry in a dictionary has a search key. 4.Each entry in a dictionary may only have one key. 5.The ADT dictionary requires sorted entries. 6.Whether a dictionary has sorted or unsorted search keys is an implementation detail. 7.You can traverse the dictionary by search keys but not by values. 8.Restricting the ADT dictionary to distinct search keys simplifies the implementation of the remove method. 9.The ADT dictionary does not permit key-null pairs. 10.A key that has no value associated with it does not appear in the dictionary. 11.You cannot traverse a dictionary by both the keys and values in parallel.
Image of page 1
12.You can traverse all the keys in a dictionary without traversing the values. 13.You cannot traverse all the values in a dictionary without traversing the keys. 14.A sorted dictionary must use search keys that belong to a class that implements the interface Comparable. 15.The default delimiter for the class Scanner is a white-space character. 16.Duplicate search keys are not permitted in a dictionary that conforms to the Java Class Library Map interface. 17.When using a Scanner object to process text, you can specify any character as a delimiter. Short Answer (8) 1.Write a statement to create an instance of a class Dictionary that implements DictionaryInterface. Your dictionary contains Word objects that are lists of synonyms for words. The key value is a String representing the word to look up. Call your dictionary thesaurus .
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 7 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture