摘要: Remove Nth Node From End of List:Given a linked list, remove the nth node from the end of list and return its head.For example: Given linked list: 1->2->3->4->5, and n = 2. After removing the second n... 阅读全文
posted @ 2016-01-13 19:16 Lewisr 阅读(91) 评论(0) 推荐(0)
摘要: Delete Node in a Linked List: 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 -> 2 -> 3 -> 4 and you are given... 阅读全文
posted @ 2016-01-13 18:59 Lewisr 阅读(118) 评论(0) 推荐(0)
摘要: Ugly Number:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugl... 阅读全文
posted @ 2016-01-13 18:52 Lewisr 阅读(114) 评论(0) 推荐(0)