-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
24 lines (21 loc) · 844 Bytes
/
Copy pathProgram.cs
File metadata and controls
24 lines (21 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Collections.Generic;
using System.Dynamic;
namespace LRUCache
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("LRU Cache Demo");
var lcache = new LCache<string, string>(3);
lcache.Put("prakash", "shetty");
lcache.Put("ajit", "ganiga");
lcache.Put("prathik", "rai");
Console.WriteLine($"1. Head : {lcache.Front()} Tail : {lcache.Tail()}");
Console.WriteLine($"accessing 'prakash' value returned: {lcache.Get("prakash")}");
Console.WriteLine($"2. Head : {lcache.Front()} Tail : {lcache.Tail()}");
lcache.Put("adhip", "kamat");
Console.WriteLine(String.Format("3. Head : {0} Tail : {1}", lcache.Front(), lcache.Tail()));
}
}
}