Answer to Question #148888 in Java | JSP | JSF for Sathu

Question #148888
Evaluvate three benefits of using implementation independent data structure
1
Expert's answer
2020-12-06T20:29:12-0500

Abstract data types(Implementation independent data structures) offer several advantages over concrete data structures:

  • Representation Independence: Most of the program becomes independent of the abstract data type's representation, so that representation can be improved without breaking the entire program.
  • Modularity: With representation independence, the different parts of a program become less dependent on other parts and on how those other parts are implemented.
  • Interchangeability of Parts: Different implementations of an abstract data type may have different performance characteristics. With abstract data types, it becomes easier for each part of a program to use an implementation of its data types that will be more efficient for that particular part of the program.

Example:

Java's standard libraries supply several different implementations of its Map data type. The TreeMap implementation might be more efficient when a total ordering on the keys can be computed quickly but a good hash value is hard to compute efficiently. The HashMap implementation might be more efficient when hash values can be computed quickly and there is no obvious ordering on keys. The part of a program that creates a Map can decide which implementation to use. The parts of a program that deal with a created Map don't have to know how it was implemented; once created, it's just a Map.

If it weren't for abstract data types, every part of the program that uses a Map would have to be written twice, with one version to deal with TreeMap implementations and another version to deal with HashMap implementations.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog