摘要: 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 exa 阅读全文
posted @ 2016-03-22 15:16 白天黑夜每日c 阅读(105) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-03-22 15:12 白天黑夜每日c 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2016-03-22 14:54 白天黑夜每日c 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-03-22 14:48 白天黑夜每日c 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. 编译错误。。。不愿debug,之后继续 阅读全文
posted @ 2016-03-22 11:44 白天黑夜每日c 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 阅读全文
posted @ 2016-03-22 09:38 白天黑夜每日c 阅读(131) 评论(0) 推荐(0) 编辑