Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Table<K, V> where K : notnull;
- private IEnumerable<LinkedListNode<V>> GetNodes(K key)
- {
- if (!_records.TryGetKey(key, out var record))
- yield break;
- LinkedListNode<V> node = record.Head;
- for (int i = 0; i < record.Count; i++)
- {
- yield return node.Value;
- node = node.Next!;
- }
- }
- private readonly Dictionary<K, Record> _records = [];
- private readonly LinkedList<V> _values = [];
- private readonly record struct Record(LinkedListNode<V> Head, int Count);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement