摘要:
题目: Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion? 答案: 判断一个数 阅读全文
摘要:
问题: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin t 阅读全文
摘要:
问题: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is l 阅读全文
摘要:
question: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? answer: 思路:把前半部分的链表翻转,再分 阅读全文
摘要:
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: 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 - 阅读全文