- 博客(9)
- 收藏
- 关注
原创 拷贝VMware造成mac地址冲突的问题
ifconfig eth0 显示网卡地址出新的网卡地址 修改/etc/sysconfig/network-scripts/ifcfg-eth0文件中的这一项HWADDR,使之与新的网卡地址对应 然后重启网络 service network restart
2015-10-31 14:18:15 2789
原创 Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, fin
2015-10-28 17:56:08 295
原创 Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path
2015-10-17 10:26:49 281
原创 Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair:
2015-10-15 08:50:37 235
原创 Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example: Given “25525511135”,return [“255.255.11.135”, “255.255.111.35”]. (Order does not
2015-10-13 15:13:11 323
原创 Binary Tree Paths
Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \ 2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]public class Solution { publi
2015-10-11 21:37:07 208
原创 ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N A P L S I I G Y
2015-10-08 16:27:12 201
原创 Sort List
Sort a linked list in O(n log n) time using constant space complexity.思路: 利用归并排序的思想,每一次采用快慢指正找出链表的中点,将中点左边的链表进行排序,然后中点右边的链表进行排序,最后将排好序的左右两边的链表进行归并。public class Solution { public ListNode sortList(
2015-10-07 18:57:38 163
原创 Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.思路: 很显然,数组中出现的次数多于 ⌊ n/3 ⌋次数的数字只能出现最多两次。考虑数组中出现次数多于 ⌊
2015-10-07 16:05:29 284
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人