資源簡介
LRUDemo-頁面置換算法LRU模擬c#
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
namespace?LRUDemo
{
????public?class?LRU
????{
????????private?Memory?_Memory;
????????public?LRU(Memory?memory)
????????{
????????????_Memory?=?memory;
????????}
????????public?void?Push(int?item)
????????{
????????????if?(_Memory.Contains(item))
????????????{
????????????????_Memory.RemoveAt(_Memory.IndexOf(item));
????????????????_Memory.Add(item);
????????????}
????????????else
????????????{
????????????????if?(_Memory.IsFull)
????????????????{
????????????????????_Memory.RemoveAt(0);?
????????????????}
????????????????_Memory.Add(item);
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7680??2014-06-04?10:21??LRUDemo\bin\Debug\LRUDemo.exe
?????文件??????22016??2014-06-04?10:21??LRUDemo\bin\Debug\LRUDemo.pdb
?????文件??????11600??2014-06-04?10:29??LRUDemo\bin\Debug\LRUDemo.vshost.exe
?????文件????????490??2010-03-17?22:39??LRUDemo\bin\Debug\LRUDemo.vshost.exe.manifest
?????文件????????708??2014-06-04?10:19??LRUDemo\LRU.cs
?????文件???????2506??2014-06-04?09:39??LRUDemo\LRUDemo.csproj
?????文件???????2752??2014-06-04?10:21??LRUDemo\Memory.cs
?????文件???????5774??2014-06-04?10:21??LRUDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????212??2014-06-04?10:29??LRUDemo\obj\x86\Debug\LRUDemo.csproj.FileListAbsolute.txt
?????文件???????7680??2014-06-04?10:21??LRUDemo\obj\x86\Debug\LRUDemo.exe
?????文件??????22016??2014-06-04?10:21??LRUDemo\obj\x86\Debug\LRUDemo.pdb
?????文件????????589??2014-06-04?10:16??LRUDemo\Program.cs
?????文件???????1356??2014-06-04?09:28??LRUDemo\Properties\AssemblyInfo.cs
?????文件????????863??2014-06-04?09:28??LRUDemo.sln
?????目錄??????????0??2014-06-04?09:28??LRUDemo\obj\x86\Debug\TempPE
?????目錄??????????0??2014-06-04?10:21??LRUDemo\obj\x86\Debug
?????目錄??????????0??2014-06-04?09:47??LRUDemo\bin\Debug
?????目錄??????????0??2014-06-04?09:28??LRUDemo\obj\x86
?????目錄??????????0??2014-06-04?09:28??LRUDemo\bin
?????目錄??????????0??2014-06-04?09:28??LRUDemo\obj
?????目錄??????????0??2014-06-04?09:28??LRUDemo\Properties
?????目錄??????????0??2014-06-04?09:33??LRUDemo
-----------?---------??----------?-----??----
????????????????86242????????????????????22
- 上一篇:WeiXin調試工具
- 下一篇:RoundRobinDemo- c#時間片輪轉算法
評論
共有 條評論