摘要:
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 - 阅读全文
posted @ 2016-09-11 05:51
Machelsky
阅读(103)
评论(0)
推荐(0)
摘要:
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 like: 阅读全文
posted @ 2016-09-11 05:34
Machelsky
阅读(149)
评论(0)
推荐(0)
摘要:
Invert a binary tree. to 阅读全文
posted @ 2016-09-11 05:14
Machelsky
阅读(123)
评论(0)
推荐(0)
摘要:
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size tha 阅读全文
posted @ 2016-09-11 04:02
Machelsky
阅读(164)
评论(0)
推荐(0)
摘要:
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2016-09-11 03:18
Machelsky
阅读(159)
评论(0)
推荐(0)
摘要:
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Solution1: 这道题做的太麻烦了,corner case很多,碰到负数不知道怎么给reverse。强行转成st 阅读全文
posted @ 2016-09-11 03:00
Machelsky
阅读(154)
评论(0)
推荐(0)