Show / Hide Table of Contents

    Class LRUCache<K, V>

    A least recently used cache implemetation.

    Inheritance
    Object
    LRUCache<K, V>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Advanced.Algorithms.Distributed
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class LRUCache<K, V>
    Type Parameters
    Name Description
    K
    V

    Constructors

    LRUCache(Int32)

    Declaration
    public LRUCache(int capacity)
    Parameters
    Type Name Description
    Int32 capacity

    Methods

    Get(K)

    Time complexity: O(1).

    Declaration
    public V Get(K key)
    Parameters
    Type Name Description
    K key
    Returns
    Type Description
    V

    Put(K, V)

    Time complexity: O(1).

    Declaration
    public void Put(K key, V value)
    Parameters
    Type Name Description
    K key
    V value
    Back to top Generated by DocFX