网上的方案我没有使用。对于只有一个网卡的主机来说,它的ip只有一个。可用shell命令获取到这个ip。官方的live555的live/groupsock/GroupsockHelper.cpp里面的函数ourIPAddress如下: 1 netAddressBits ourIPAddress(Us....
分类:
其他好文 时间:
2014-11-29 15:57:56
阅读次数:
2116
Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give...
分类:
其他好文 时间:
2014-11-29 15:49:23
阅读次数:
135
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the c...
分类:
其他好文 时间:
2014-11-29 11:38:05
阅读次数:
124
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-11-29 11:37:32
阅读次数:
131
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-11-28 17:32:06
阅读次数:
184
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
#include
#include
typedef struct ListNode {
int val;
struct ListNode *nex...
分类:
其他好文 时间:
2014-11-28 16:21:41
阅读次数:
179
要求:判断一棵树是否是平衡二叉树Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree i...
分类:
其他好文 时间:
2014-11-27 17:44:31
阅读次数:
140
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:
其他好文 时间:
2014-11-27 16:30:19
阅读次数:
226
Path Sum
Total Accepted: 31405 Total
Submissions: 104326My Submissions
Question
Solution
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that add...
分类:
其他好文 时间:
2014-11-27 09:15:36
阅读次数:
151
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2014-11-27 06:44:59
阅读次数:
215