摘要:
question: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 阅读全文
摘要:
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 阅读全文
摘要:
question: Reverse a singly linked list. answer: 使用三个指针遍历单链表,逐个链接点进行反转。 阅读全文
摘要:
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 - 阅读全文
摘要:
question: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". answer: 交换字符串中的元素 阅读全文
摘要:
1.线性表是由相同数据类型的 n 个数据元素a0,a1,......,an-1 组成的有限序列。一个数据元素可以由若干个数据项组成。若用 L 命名线性表,则其一般表示如下: L=(a0,a1,......,an-1) 其中, a0 是唯一的“第一个”数据元素,又称为表头元素;an-1 是唯一 阅读全文