Skip to content

SortedMap is an interface in the collection framework. This interface extends the Map interface and provides a total ordering of its elements. eg TreeMap

Notifications You must be signed in to change notification settings

ochiyeng/sortedmap-algorithm-in-java

Repository files navigation

#sortedmap-algorithm-in-java SortedMap is an interface in collection framework. This interface extends Map interface and provides a total ordering of its elements.eg TreeMap The SortedMap interface extends Map and creates a display in which all elements are sorted in ascending order of their keys. SortedMap adds a number of methods: K firstKey(): returns the key of the first display element

K lastKey(): returns the key of the last display item

SortedMap<K, V> headMap(K end): returns a SortedMap display that contains all the elements of the original SortedMap up to the element with the key end

SortedMap<K, V> tailMap(K start): returns a SortedMap display that contains all the elements of the original SortedMap, starting with the element with the start key

SortedMap<K, V> subMap(K start, K end): returns a SortedMap display that contains all the elements of the original SortedMap, from the element with the start key to the element with the end key https://docs.oracle.com/javase/8/docs/api/java/util/SortedMap.html

About

SortedMap is an interface in the collection framework. This interface extends the Map interface and provides a total ordering of its elements. eg TreeMap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages