摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-03-06 16:42 ZHOU YANG 阅读(199) 评论(0) 推荐(0)
摘要: Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assum 阅读全文
posted @ 2016-03-06 16:21 ZHOU YANG 阅读(229) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2016-03-06 16:19 ZHOU YANG 阅读(343) 评论(0) 推荐(0)
摘要: 在c++中,没有java与python中定义的split()功能的函数,于是自己实现之。 情况1,适用范围,分隔符为字符。思路,记录分隔符的位置,判断需要截取的字符串的下标范围。 vector<string> split(string s,char ch){ int start=0; int len 阅读全文
posted @ 2016-03-06 13:52 ZHOU YANG 阅读(3508) 评论(0) 推荐(0)