摘要: 题目描述:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like... 阅读全文
posted @ 2015-12-22 09:50 scottwang 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthe... 阅读全文
posted @ 2015-12-22 09:48 scottwang 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 题目描述: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 is1 -> 2 -> ... 阅读全文
posted @ 2015-12-22 09:47 scottwang 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, g... 阅读全文
posted @ 2015-12-22 09:45 scottwang 阅读(218) 评论(0) 推荐(0) 编辑