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-24 10:11:36
阅读次数:
152
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a pa...
分类:
其他好文 时间:
2014-11-24 10:10:28
阅读次数:
152
Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exampl...
分类:
其他好文 时间:
2014-11-23 17:13:25
阅读次数:
203
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-22 00:43:18
阅读次数:
130
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-11-21 21:41:20
阅读次数:
252
A fast method to determine the number is odd or even:total & 0x1 //true, if total is oddtotal & 0x1 //false, if total is evenProblem StatementThere ar...
分类:
其他好文 时间:
2014-11-21 20:28:27
阅读次数:
151
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Targets.htmlViewingtheDefaultTargetTodeterminewhichtargetunitisusedbydefault,runthefollowingcommand:systemctlget-de..
分类:
其他好文 时间:
2014-11-21 16:30:31
阅读次数:
223
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题用来判断链表中是否有循环,最开始我想的是遍历链表,同时用一个list保存遍历过...
分类:
其他好文 时间:
2014-11-21 01:18:32
阅读次数:
203
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题要用双指针,但我想试一下投机取巧的办法行不行...
分类:
其他好文 时间:
2014-11-20 21:46:01
阅读次数:
185
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-11-20 13:39:29
阅读次数:
113