diff --git a/src/DataStructure/Link/Link.cs b/src/DataStructure/Link/Link.cs index 9896e55..a5cfc97 100644 --- a/src/DataStructure/Link/Link.cs +++ b/src/DataStructure/Link/Link.cs @@ -233,4 +233,18 @@ public class Link : IEnumerable Remove(res); return resValue; } + /// + /// remove the last item + /// + /// + /// + public TObject RemoveLast() + { + LinkNode res = Last; + if (res.IsEnding) + throw new Exception("TODO"); + TObject resValue = res.Value; + Remove(res); + return resValue; + } } \ No newline at end of file