Submitted by heartin on Sat, 10/10/2015 - 02:27
A Queue is a collection designed for processing elements generally in the First In First Out (FIFO) order.
Important properties of Queue interface
-
Methods in Queue interface generally exists in two forms:
-
one throws an exception if the operation fails,
-
the other returns a special value (either null or false, depending on the operation).
Submitted by heartin on Sat, 10/10/2015 - 00:44
TreeMap is a Red-Black tree based NavigableMap implementation.
Important properties of TreeMap
-
The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time.
-
Provides guaranteed log(n) time cost for the containsKey, get, put and remove operations.
Submitted by heartin on Sat, 10/10/2015 - 00:32
NavigableMap estends SortedMap with navigation methods.
Important properties of NavigableMap
-
Methods lowerEntry, floorEntry, ceilingEntry, and higherEntry return Map.Entry objects associated with keys respectively less than, less than or equal, greater than or equal, and greater than a given key, returning null if there is no such key.
-
Similarly, methods lowerKey, floorKey, ceilingKey, and higherKey return only the associated keys.
Submitted by heartin on Sat, 10/10/2015 - 00:06
SortedMap interface extends Map interface to further provide a total ordering on its keys.
Important Properties of SortedMap
-
SortedMap is ordered according to the natural ordering of its keys, or by a Comparator typically provided at sorted map creation time.
-
Order is reflected when iterating over the sorted map's collection views returned by the entrySet, keySet and values methods.
-
SortedMap is the map analogue of SortedSet.
Submitted by heartin on Fri, 10/09/2015 - 20:22
The unary operator '++expr' is a prefix operator and 'expr++' is a postfix operator.
When used in a assignment or print context (like within a print statement), a prefix operator (e.g. ++a) first increments a and then return the value of a, whereas the postfix operator (e.g. a++) returns the value of a and then increments a.
Expansions for the prefix and postfix shorthand forms
Below expansions will help you understand these operators well.
-
a++ expands to
Pages