Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question. A basic Map has methods size(), isEmpty(), containsKey(),get(),put(),remove(),clear(),keySet(), and values() , 9 methods. The basic ST has 7 methods (not counting the constructor) listed

Question. A basic Map has methods size(), isEmpty(), containsKey(),get(),put(),remove(),clear(),keySet(), and values(), 9 methods. The basic ST has 7 methods (not counting the constructor) listed here:

image text in transcribed

(a) Study each Map method in this order, and for each: i. Give its method header ii. Say which ST method is closest in action, its method header, and whether it is the same or if different, how

(b) Finally, explain what methods don't match up. Explain how to work around any missing actions by use of the provided methods.

public class ST ST() void put(key key, Value val) Value va a[key] = val; a[key] Value get(key key) void delete(key key) boolean contains (Key key) boolean isEmpty() int size() Iterable keys() create a symbol table put key-value pair into the table (remove key from table if value is null) value paired with key null if key is absent) remove key (and its value) from table is there a value paired with key? is the table empty? number of key-value pairs in the table all the keys in the table API for a generic basic symbol table public class ST ST() void put(key key, Value val) Value va a[key] = val; a[key] Value get(key key) void delete(key key) boolean contains (Key key) boolean isEmpty() int size() Iterable keys() create a symbol table put key-value pair into the table (remove key from table if value is null) value paired with key null if key is absent) remove key (and its value) from table is there a value paired with key? is the table empty? number of key-value pairs in the table all the keys in the table API for a generic basic symbol table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago