摘要:
说到递归,就不得不提大名鼎鼎的斐波那契数列,这个最早接触应该还是高中数学的数列部分,后来学C语言的时候,老师讲递归就是举的这个例子。表达式如下: 代码就是下面这个样子: public static int fib(int num) { if (num == 1 || num == 2) { retu 阅读全文
摘要:
Given a linked list, remove the n th node from the end of list and return its head. example: 节点定义: 思路一:使用两个指针,第一个指针先走n步,后面两个指针同时走,当第一个指针走到最后的时候,第二指针指的 阅读全文