摘要: question: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return:  阅读全文
posted @ 2016-06-28 22:27 绵绵思远道 阅读(92) 评论(0) 推荐(0) 编辑
摘要: question: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 阅读全文
posted @ 2016-06-28 20:47 绵绵思远道 阅读(130) 评论(0) 推荐(0) 编辑
摘要: question: Reverse a singly linked list. answer: 使用三个指针遍历单链表,逐个链接点进行反转。 阅读全文
posted @ 2016-06-28 19:09 绵绵思远道 阅读(120) 评论(0) 推荐(0) 编辑
摘要: question: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 - 阅读全文
posted @ 2016-06-28 19:02 绵绵思远道 阅读(134) 评论(0) 推荐(0) 编辑
摘要: question: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". answer: 交换字符串中的元素 阅读全文
posted @ 2016-06-28 18:51 绵绵思远道 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1.线性表是由相同数据类型的 n 个数据元素a0,a1,......,an-1 组成的有限序列。一个数据元素可以由若干个数据项组成。若用 L 命名线性表,则其一般表示如下: L=(a0,a1,......,an-1) 其中, a0​​ 是唯一的“第一个”数据元素,又称为表头元素;an-1​​ 是唯一 阅读全文
posted @ 2016-06-28 18:31 绵绵思远道 阅读(755) 评论(0) 推荐(0) 编辑