<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>算法 on 知识铺的博客</title>
    <link>https://index.zshipu.com/geek/categories/%E7%AE%97%E6%B3%95/</link>
    <description>Recent content in 算法 on 知识铺的博客</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-CN</language>
    <lastBuildDate>Fri, 20 Nov 2020 23:39:09 +0000</lastBuildDate>
    <atom:link href="https://index.zshipu.com/geek/categories/%E7%AE%97%E6%B3%95/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>LRU cache implementation</title>
      <link>https://index.zshipu.com/geek/post/arithmetic/lru-cache/</link>
      <pubDate>Fri, 20 Nov 2020 23:39:09 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/arithmetic/lru-cache/</guid>
      <description>LRU cache stand for Least Recently Used Cache,which evict least recently used entry.As Cache purpose is to provide fast and efficient way of retrieving data, it need to meet certain requirement. Some of the Requirement are fixed size:cache need to have some bounds to limit memory usages. Fast Access:Cache Inert and lookup operation should be fast, preferably O(1) time Replacement of Entry in case,Memory Limit is reached:A cache shoule have efficient algorithm to evict when memory is full. In case of LRU cache we evict least recently used entry so we have to keep track of recently used entries, entries which have not been used from long time and which have been used recently, plus lookup and insertion operation should be fast enough . When we think about O(1) lookup, obvious data structure comes in our mind is HashMap.HashMap provide</description>
    </item>
    <item>
      <title>图片引发的思考</title>
      <link>https://index.zshipu.com/geek/post/arithmetic/babylon/</link>
      <pubDate>Wed, 18 Nov 2020 22:48:43 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/arithmetic/babylon/</guid>
      <description>在博客中看到这张有趣的图片，自己加了点扩展 自动证明了 (a+b)^2 = a^2 + 2ab + b^2 (a-b)^2 = a^2 - 2ab + b^2</description>
    </item>
    <item>
      <title>寻找下一个数</title>
      <link>https://index.zshipu.com/geek/post/arithmetic/find-next-numnber/</link>
      <pubDate>Sun, 15 Nov 2020 23:03:38 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/arithmetic/find-next-numnber/</guid>
      <description>寻找下一个数字，例如输入345，输出354 思路：从最右边位和上一位对比，如果大，就往前移，移动完，尾数排序，从大到小，保证次大 -代码 //字符串逆序 NSString *reverseStr(NSString *str){ NSMutableString *string=[[NSMutableString alloc] init]; for(int i=0;i&amp;lt;str.length;i++){ [string appendString:[str substringWithRange:NSMakeRange(str.length-1-i, 1)]]; } return string; } //字符串分成数组 NSMutableArray *separateStringToArray(NSString *str){ NSMutableArray *marr = [NSMutableArray array]; for (NSInteger i = 0; i &amp;lt; str.length; i++) { [marr addObject:[str substringWithRange:NSMakeRange(i, 1)]]; } return marr; } NSString *findNextLargerNum(NSString *oriNum){ NSMutableString *finalStr = [NSMutableString string]; NSMutableArray *marr = separateStringToArray(oriNum); for (NSInteger i</description>
    </item>
  </channel>
</rss>
