数据结构与算法之美

为工程师量身打造的数据结构与算法私教课


春节7天练 | Day 4:散列表和字符串

<p><img src="https://static001.geekbang.org/resource/image/8c/4c/8c241e9fe88077c52d071d5f9afd664c.jpg" alt="" /></p> <p>你好,我是王争。初四好!</p> <p>为了帮你巩固所学,真正掌握数据结构和算法,我整理了数据结构和算法中,必知必会的 30 个代码实现,分 7 天发布出来,供你复习巩固所用。今天是第四篇。</p> <p>和昨天一样,你可以花一点时间,来完成测验。测验完成后,你可以根据结果,回到相应章节,有针对性地进行复习。</p> <p>前几天的内容。如果你错过了,点击文末的“<font color="orange">上一篇</font>”,即可进入测试。</p> <hr /> <h2>关于散列表和字符串的 4 个必知必会的代码实现</h2> <h3>散列表</h3> <ul> <li> <p>实现一个基于链表法解决冲突问题的散列表</p> </li> <li>实现一个 LRU 缓存淘汰算法</li> </ul> <h3>字符串</h3> <ul> <li> <p>实现一个字符集,只包含 a~z 这 26 个英文字母的 Trie 树</p> </li> <li>实现朴素的字符串匹配算法</li> </ul> <h2>对应的 LeetCode 练习题(@Smallfly 整理)</h2> <h3>字符串</h3> <ul> <li>Reverse String (反转字符串)</li> </ul> <p>英文版:<a href="https://leetcode.com/problems/reverse-string/"><a href="https://leetcode.com/problems/reverse-string/">https://leetcode.com/problems/reverse-string/</a></a></p> <p>中文版:<a href="https://leetcode-cn.com/problems/reverse-string/"><a href="https://leetcode-cn.com/problems/reverse-string/">https://leetcode-cn.com/problems/reverse-string/</a></a></p> <ul> <li>Reverse Words in a String(翻转字符串里的单词)</li> </ul> <p>英文版:<a href="https://leetcode.com/problems/reverse-words-in-a-string/"><a href="https://leetcode.com/problems/reverse-words-in-a-string/">https://leetcode.com/problems/reverse-words-in-a-string/</a></a></p> <!-- [[[read_end]]] --> <p>中文版:<a href="https://leetcode-cn.com/problems/reverse-words-in-a-string/"><a href="https://leetcode-cn.com/problems/reverse-words-in-a-string/">https://leetcode-cn.com/problems/reverse-words-in-a-string/</a></a></p> <ul> <li>String to Integer (atoi)(字符串转换整数 (atoi))</li> </ul> <p>英文版:<a href="https://leetcode.com/problems/string-to-integer-atoi/"><a href="https://leetcode.com/problems/string-to-integer-atoi/">https://leetcode.com/problems/string-to-integer-atoi/</a></a></p> <p>中文版:<a href="https://leetcode-cn.com/problems/string-to-integer-atoi/"><a href="https://leetcode-cn.com/problems/string-to-integer-atoi/">https://leetcode-cn.com/problems/string-to-integer-atoi/</a></a></p> <hr /> <p>做完题目之后,你可以点击“请朋友读”,把测试题分享给你的朋友,说不定就帮他解决了一个难题。</p> <p>祝你取得好成绩!明天见!</p>

页面列表

ITEM_HTML