COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Are libraries for BST
|
|
Are libraries for Vector
|
|
Are libraries for graph
|
|
None of the above
|
Detailed explanation-1: -In Java, a TreeMap is a red-black tree, which is a self-balancing binary search tree.
Detailed explanation-2: -The TreeSet uses a self-balancing binary search tree, more specifically a Red-Black tree. Simply put, being a self-balancing binary search tree, each node of the binary tree comprises of an extra bit, which is used to identify the color of the node which is either red or black.
Detailed explanation-3: -Java HashMap is a hashtable based implementation of Map interface. Java TreeMap is a Tree structure-based implementation of Map interface. Interface Implements. HashMap implements Map, Cloneable, and Serializable interface. TreeMap implements NavigableMap, Cloneable, and Serializable interface.
Detailed explanation-4: -TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order. TreeMap is an implementation of Map Interface . TreeMap is also Implementation of NavigableMap along with AbstractMap class.