TreeMap


Object Hierarchy:

Object hierarchy for TreeMap

Description:

public class TreeMap<K,V> : Object

A sorted map backed by a balanced binary search tree.

Keys are ordered according to a comparison function provided at construction time. Provides O(log n) lookup, insertion, and deletion. Inspired by Java's TreeMap.

Example:

    var map = new TreeMap<string,string> ((a, b) => {
return strcmp (a, b);
});
map.put ("banana", "yellow");
map.put ("apple", "red");
map.put ("cherry", "red");
assert (map.firstKey () == "apple");
assert (map.lastKey () == "cherry");


Namespace: Vala.Collections
Package: Valacore

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object