Ejemplo n.º 1
0
        public PersistentMap <K, T> Assign(K key, T value)
        {
            if (root == null)
            {
                return(new PersistentTreapMap <K, T>(new TreapNode(key, value)));
            }
            TreapNode y = root.Find(key);

            if (y == null)
            {
                return(new PersistentTreapMap <K, T>(root.Insert(new TreapNode(key, value))));
            }
            return(new PersistentTreapMap <K, T>(root.Change(key, value)));
        }