由买买提看人间百态

topics

全部话题 - 话题: heada
(共0页)
h*c
发帖数: 23
1
来自主题: JobHunting版 - 求两个链表的最大公共后缀
Another solution: virtually concatenate two linked list
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if (!headA || !headB)
return NULL;

ListNode *currA = headA, *currB = headB;
while (currA != currB) {
currA = (currA) ? currA->next : headB;
currB = (currB) ? currB->next : headA;
}
return currA;
}
m*****r
发帖数: 37
2
来自主题: Programming版 - Java弱弱请救几个小问题
我是最近刚转Java的弱弱,有几个小问题,请牛牛们轻拍。
这次转java,总算像是某位说的那样,原来c++转java也就分分钟的事儿。写得顺的时
候,边google边写,也可以写得稀里糊涂、腾云架雾、行云流水;可问题是bug一出现
,立马歇菜!比如,min stack, stack1.peek()==stack2.peek(),顶上的两个数字明明
是相等的,为什么会return false呢?想去google都不知道该搜什么。。。等把java刷
一遍lc就算我可以写java了?
我有个function, public boolean dfdjdf(){return dfkld;} 为什么它一定要我在最
后一句话加个return啊,方法里的逻辑到那一步早就应该已经return了啊?
还有就是,刷lc搭了个local的架,本来没什么心理障碍,可是每遇到有Node,
ListNode, TreeNode的题就一股无名火,我不知道该把这些定义的类塞到哪里?试过两
种:
public class getIntersectionNode {
public class ListNode {
... 阅读全帖

发帖数: 1
3
来自主题: JobHunting版 - 两个链表怎么查找相交点?
把两个链表互相连接起来就好。
1->2->3
2->3
1->2->3->2->3
2->3->1->2->3
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
ListNode a = headA;
ListNode b = headB;
while (a != b) {
if (a == null) {
a = headB;
} else {
a = a.next;
}
if (b == null) {
b = headA;
} else {
b = b.next;
}
}
return a;
}
H***T
发帖数: 36
4
来自主题: PhotoGear版 - 有人从jet.com上买过镜头吗
Hello there,
Unfortunately I've looked into this situation a bit for you. On Jet we do
sell all sorts of products that are manufactured outside of the U.S. I
apologize, I'm not sure where the previous representative saw that the item
would be made in the U.S. Right now the only option we would really have is
to return the item for a full refund. I'm so sorry about the inconvenience
this may have caused. If you have any other questions please let us know.
I hope you have a great night, again I ap... 阅读全帖
H***T
发帖数: 36
5
来自主题: PhotoGear版 - 有人从jet.com上买过镜头吗
Hello there,
Unfortunately I've looked into this situation a bit for you. On Jet we do
sell all sorts of products that are manufactured outside of the U.S. I
apologize, I'm not sure where the previous representative saw that the item
would be made in the U.S. Right now the only option we would really have is
to return the item for a full refund. I'm so sorry about the inconvenience
this may have caused. If you have any other questions please let us know.
I hope you have a great night, again I ap... 阅读全帖
L*D
发帖数: 3966
6
来自主题: ChineseMed版 - 谁知道猪流感的详细症状?
你准备怎样防范?准备些什么药?能写一下吗?Thanks.
http://www.cdc.gov/swineflu/swineflu_you.htm
Is this swine flu virus contagious?
CDC has determined that this swine influenza A (H1N1) virus is contagious
and is spreading from human to human. However, at this time, it not known
how easily the virus spreads between people.
What are the signs and symptoms of swine flu in people?
The symptoms of swine flu in people are similar to the symptoms of regular
human flu and include fever, cough, sore throat, body aches, heada
(共0页)