你好,我是王争。初二好!
为了帮你巩固所学,真正掌握数据结构和算法,我整理了数据结构和算法中,必知必会的30个代码实现,分7天发布出来,供你复习巩固所用。今天是第二篇。
和昨天一样,你可以花一点时间,来完成测验。测验完成后,你可以根据结果,回到相应章节,有针对性地进行复习。


关于栈、队列和递归的几个必知必会的代码实现

  • 用数组实现一个顺序栈
  • 用链表实现一个链式栈
  • 编程模拟实现一个浏览器的前进、后退功能

队列

  • 用数组实现一个顺序队列
  • 用链表实现一个链式队列
  • 实现一个循环队列

递归

  • 编程实现斐波那契数列求值f(n)=f(n-1)+f(n-2)
  • 编程实现求阶乘n!
  • 编程实现一组数据集合的全排列

对应的LeetCode练习题(@Smallfly 整理)

  • Valid Parentheses(有效的括号)

英文版:https://leetcode.com/problems/valid-parentheses/
中文版:https://leetcode-cn.com/problems/valid-parentheses/

  • Longest Valid Parentheses(最长有效的括号)

英文版:https://leetcode.com/problems/longest-valid-parentheses/
中文版:https://leetcode-cn.com/problems/longest-valid-parentheses/

  • Evaluate Reverse Polish Notatio(逆波兰表达式求值)

英文版:https://leetcode.com/problems/evaluate-reverse-polish-notation/
中文版:https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/

队列

  • Design Circular Deque(设计一个双端队列)

英文版:https://leetcode.com/problems/design-circular-deque/
中文版:https://leetcode-cn.com/problems/design-circular-deque/

  • Sliding Window Maximum(滑动窗口最大值)

英文版:https://leetcode.com/problems/sliding-window-maximum/
中文版:https://leetcode-cn.com/problems/sliding-window-maximum/

递归

  • Climbing Stairs(爬楼梯)

英文版:https://leetcode.com/problems/climbing-stairs/
中文版:https://leetcode-cn.com/problems/climbing-stairs/


昨天的第一篇,是关于数组和链表的,如果你错过了,点击文末的“上一篇”,即可进入测试。
祝你取得好成绩!明天见!