func (s *LRUCache[K, V]) Put(key K, value V) {
	if s.capacity == s.Size() {
		element := s.linkedList.Back()
		if element == nil {
			return
		}
		s.remove(element.Value.(*LRUEntry[K, V]).Key)
	}

	lruEntry := &LRUEntry[K, V]{Key: key, Value: value}
	listElement := s.linkedList.PushFront(lruEntry)
	s.hashMap[key] = listElement
}
// Put key/value pair into the cache
Put key/value pair into the cache
// Put key / value pair into the cache
func (s *LRUCache[K, V]) Put(key K, value V) {
	if s.capacity == s.Size() {
		element := s.linkedList.Back()
		if element == nil {
			return
		}
		s.remove(element.Value.(*LRUEntry[K, V]).Key)
	}
	lruEntry := &LRUEntry[K, V]{Key: key, Value: value}
	listElement := s.linkedList.PushFront(lruEntry)
	s.hashMap[key] = listElement
}
func ( s * LRUCache [ K , V ] ) Put ( key K , value V ) { if s . capacity == s . Size ( ) { element := s . linkedList . Back ( ) if element == nil { return } s . remove ( element . Value . ( * LRUEntry [ K , V ] ) . Key ) } lruEntry := & LRUEntry [ K , V ] { Key : key , Value : value } listElement := s . linkedList . PushFront ( lruEntry ) s . hashMap [ key ] = listElement }
Put key/value pair into the cache
Put key / value pair into the cache