avatar
l*a
1
这个reviewer 在review的开始说自己不懂这个topic,然后写了n页意见,其中包括对
我paper里最基本概念的不理解,和要求我用layman's term解释该基本概念,那个概念
在我们这个领域基本到什么水平,应该就像加速度在经典物理学里面一样的那种概念
我想问问各位老师,怎么回复,我已经无语了
avatar
i*e
2
These are some original pointer problems from me. Try to solve without a
compiler's help. Post your answers here by replying to this post.
Assume you have the following linked list defined as:
struct Node {
Node(int x) : val(x), next(NULL) {}
int val;
Node *next;
};
And you have a printList function which prints out the content of a list.
What are the outputs for the following code segments?
avatar
j*x
3
一个小女孩到西饼店买早点。
她对老板说:老板!买个巧克力娃娃。
老板:你要男娃还是女娃?
女孩:当然是要男娃娃喽!因为能吃的地方多了一点。
avatar
p*t
4
挑几个你觉得说得过去的稍微解释一下。

【在 l**a 的大作中提到】
: 这个reviewer 在review的开始说自己不懂这个topic,然后写了n页意见,其中包括对
: 我paper里最基本概念的不理解,和要求我用layman's term解释该基本概念,那个概念
: 在我们这个领域基本到什么水平,应该就像加速度在经典物理学里面一样的那种概念
: 我想问问各位老师,怎么回复,我已经无语了

avatar
d*d
5
avatar
l*a
6
好吧,我就是不太理解为什么要求我用 layman's term 在一篇research paper里面解
释最基本的概念
谢谢,这还是领域内顶尖的期刊,怎么这样子

【在 p**********t 的大作中提到】
: 挑几个你觉得说得过去的稍微解释一下。
avatar
r*n
7
avatar
j*n
8
写到supplementary里去
写在多都没问题

【在 l**a 的大作中提到】
: 这个reviewer 在review的开始说自己不懂这个topic,然后写了n页意见,其中包括对
: 我paper里最基本概念的不理解,和要求我用layman's term解释该基本概念,那个概念
: 在我们这个领域基本到什么水平,应该就像加速度在经典物理学里面一样的那种概念
: 我想问问各位老师,怎么回复,我已经无语了

avatar
g*f
9
*p = new Node(4);
p = &((*p)->next);
avatar
b*0
10
要是真像你说的,editor能看出来的。rebuttal 里面引用本科生的教科书轻轻拍打,
语气温柔些。

【在 l**a 的大作中提到】
: 这个reviewer 在review的开始说自己不懂这个topic,然后写了n页意见,其中包括对
: 我paper里最基本概念的不理解,和要求我用layman's term解释该基本概念,那个概念
: 在我们这个领域基本到什么水平,应该就像加速度在经典物理学里面一样的那种概念
: 我想问问各位老师,怎么回复,我已经无语了

avatar
m*2
11
that's what i thought too.
But i tried it with GCC.
it works.
The first replier (dinohound) got it all right.

【在 g**f 的大作中提到】
: *p = new Node(4);
: p = &((*p)->next);

avatar
p*b
12
LOL...
可以直接向editor complain吗?

【在 b*********0 的大作中提到】
: 要是真像你说的,editor能看出来的。rebuttal 里面引用本科生的教科书轻轻拍打,
: 语气温柔些。

avatar
i*e
13
dinohound,你的答案是完全正确的。
看来大家还是对 LEVEL 3 的感到有些混淆,那我先说我理解的,欢迎大家补充一下。
*p = new Node(4);
p = &((*p)->next);
Level 3 相信大家想问的就是应该编译会出现错误,因为 (*p)->next 不就是 NULL 吗
?然后相信很多人会对 &((*p)->next) 理解成 &(NULL),而感到不解。
我给个简单些的例子,道理其实一样:
int *p = NULL;
那 &p 是什么呢?其实就是那个 p 变量的地址,p 变量储存的值到底是什么是没有关
系的。
同样的道理, p = &((*p)->next) 也就能理解成当前链表下一个节点的地址的地址。
所以 p 指向的东西(也就是下一个节点的地址),能通过 *p 来更改(使得下一个节
点的地址更改而指向一个新建的节点)。
一些常见面试题的答案与总结 -
http://www.ihas1337code.com
avatar
b*0
14
这就等于打脸editor不会挑reviewer

【在 p*b 的大作中提到】
: LOL...
: 可以直接向editor complain吗?

avatar
g*f
15
Good explanation. Got it.

【在 i**********e 的大作中提到】
: dinohound,你的答案是完全正确的。
: 看来大家还是对 LEVEL 3 的感到有些混淆,那我先说我理解的,欢迎大家补充一下。
: *p = new Node(4);
: p = &((*p)->next);
: Level 3 相信大家想问的就是应该编译会出现错误,因为 (*p)->next 不就是 NULL 吗
: ?然后相信很多人会对 &((*p)->next) 理解成 &(NULL),而感到不解。
: 我给个简单些的例子,道理其实一样:
: int *p = NULL;
: 那 &p 是什么呢?其实就是那个 p 变量的地址,p 变量储存的值到底是什么是没有关
: 系的。

avatar
l*a
16
我也是想只能用这个方法,问题是难道要我写教科书内容到一篇论文里面,即使是
supplementary里面?我简直头大……
这个reviewer提了很多问题,最多用的话就是 what does this mean? 我实在是很无语
,完全不懂这个topic你就不要接这个review的活嘛……头疼,lol

【在 j****n 的大作中提到】
: 写到supplementary里去
: 写在多都没问题

avatar
d*d
17
thanks.
这种问题可以很磨人的.

【在 i**********e 的大作中提到】
: dinohound,你的答案是完全正确的。
: 看来大家还是对 LEVEL 3 的感到有些混淆,那我先说我理解的,欢迎大家补充一下。
: *p = new Node(4);
: p = &((*p)->next);
: Level 3 相信大家想问的就是应该编译会出现错误,因为 (*p)->next 不就是 NULL 吗
: ?然后相信很多人会对 &((*p)->next) 理解成 &(NULL),而感到不解。
: 我给个简单些的例子,道理其实一样:
: int *p = NULL;
: 那 &p 是什么呢?其实就是那个 p 变量的地址,p 变量储存的值到底是什么是没有关
: 系的。

avatar
l*a
18
希望editor好好看了ta的review吧,这人写了n页,我开始还好感动,觉得碰到很负责
的reviewer,结果看到后来我简直哭笑不得lol,我会语气温柔点的,因为我能感觉得
出来ta是真的不懂在求教,lol

【在 b*********0 的大作中提到】
: 要是真像你说的,editor能看出来的。rebuttal 里面引用本科生的教科书轻轻拍打,
: 语气温柔些。

avatar
t*g
19
I don't understand how the second line in level one work. Can someone please
explain?
I think p is allocated as a pointer to pointer. But where it's pointed to is
not allocated. Why is that not a problem?

【在 i**********e 的大作中提到】
: These are some original pointer problems from me. Try to solve without a
: compiler's help. Post your answers here by replying to this post.
: Assume you have the following linked list defined as:
: struct Node {
: Node(int x) : val(x), next(NULL) {}
: int val;
: Node *next;
: };
: And you have a printList function which prints out the content of a list.
: What are the outputs for the following code segments?

avatar
c*a
20
俺觉得要求用大白话不算过分, 你的读者本来就五花八门,当然你可以说你的读者大
多数都懂,也许加引用可以解惑?
既然人家写了几大页,你的回答也不要敷衍,回答里详细点,论文里稍改点,复杂公式
后面加点注解。
avatar
m*2
21
LZ不如谈下这low-level detail.
For example:
1) How is Node** p represented in the low level?
p, the pointer to pointer to a Node, is on the stack?
where is *p located then? on the stack or the heap?
My understanding is:
Node p ==> the struct is on the stack.
Node *p ==> the pointer is on the stack, the struct is on heap
Node **P ==> the pointer of pointer is on the stack... not sure where
the other two is going to be.
In addition, does the complier keep track of RTTI of p (in case of Node
**p)? Does the complier know that it's a pointer to pointer to Node? or
it is just a generic pointer?
2)
so, when Node.Next is assigned to NULL
Node.NEXT still has valid address, pointing to 0?

【在 i**********e 的大作中提到】
: dinohound,你的答案是完全正确的。
: 看来大家还是对 LEVEL 3 的感到有些混淆,那我先说我理解的,欢迎大家补充一下。
: *p = new Node(4);
: p = &((*p)->next);
: Level 3 相信大家想问的就是应该编译会出现错误,因为 (*p)->next 不就是 NULL 吗
: ?然后相信很多人会对 &((*p)->next) 理解成 &(NULL),而感到不解。
: 我给个简单些的例子,道理其实一样:
: int *p = NULL;
: 那 &p 是什么呢?其实就是那个 p 变量的地址,p 变量储存的值到底是什么是没有关
: 系的。

avatar
l*a
22
同意lol,三个reviewer,就一个靠谱的,另外两个一个反复问基本概念,另一个更搞
笑,直接说这篇文章的类型不符合journal的要求,我就好奇ta有没有读过这个journal
,我的文章类型是journal允许的几种类型中的一种,而且最搞笑的是reviewer 1 (也
就是那个唯一靠谱的reviewer)一开始就说这篇文章属于本journal允许的某类型,很
符合本journal的宗旨,我可以直接quote reviewer 1的话来rebuttal reviewer 3 么
,LOL
以前我发过这个journal,没有这么不靠谱,现在是怎么了,亏的排名还一直涨,都这
种reviewer怎么把关的,lol

【在 b*********0 的大作中提到】
: 这就等于打脸editor不会挑reviewer
avatar
t*g
23
Never mind. I get it.
p is a pointer to a pointer to Node. It was assigned pointer to head which
is itself a pointer to Node.
I think I was tired from a long day.

please
is

【在 t******g 的大作中提到】
: I don't understand how the second line in level one work. Can someone please
: explain?
: I think p is allocated as a pointer to pointer. But where it's pointed to is
: not allocated. Why is that not a problem?

avatar
l*a
24
同意,我是在仔细的把ta所有的comments一条一条列出来准备一个一个的答复的,我一
直觉得 layman's term 和 research 不沾边的 :-(

【在 c******a 的大作中提到】
: 俺觉得要求用大白话不算过分, 你的读者本来就五花八门,当然你可以说你的读者大
: 多数都懂,也许加引用可以解惑?
: 既然人家写了几大页,你的回答也不要敷衍,回答里详细点,论文里稍改点,复杂公式
: 后面加点注解。

avatar
i*e
25
Node *head = new Node(3);
Node **p = &head;
*p = new Node(4);
p = &((*p)->next);
*p = new Node(5);
Attached is an image to visualize the pointers for level three.
Remember, a pointer always occupy 4 bytes of memory no matter what type it
is. It stores nothing but the address of the data it is pointing to (which
is a 32 bit integer). The data type is only used to do pointer arithmetic (
ie, to calculate the number of bytes to jump over to the next element in an
array).
一些常见面试题的答案与总结 -
http://www.ihas1337code.com
avatar
i*e
26
The pointer is always on the stack (it stores a 32-bit integer (the address
of the data it is pointing to)). The data it is pointing to can be on the
stack or the heap.
For example,
int *p = new int(3); // p is pointing to an int on the heap
int x = 3;
int *p = &x; // p is pointing to an int on the stack
The compiler knows that it's a pointer to pointer to Node. (you declare it
as Node **p). The pointer type is used for pointer arithmetic purpose. That'
s why a generic pointer (void *) could not perform pointer arithmetic.
Node.NEXT will have a valid address. Every variable must have a valid
address, right? Yes, and it is pointing to NULL. which means the pointer
itself has a value of 0. On the other hand, if the pointer is pointing to a
valid data, then the pointer itself would have the address of the valid data
(which must be NON-NULL(NON-ZERO)).
一些常见面试题的答案与总结 -
http://www.ihas1337code.com
avatar
G*s
27
------------ LEVEL ZERO -----------------
Node *head = new Node(3);
Node *p = head;
p = new Node(4);
0.a) printList(head);
3
0.b) printList(p);
4
------------ LEVEL ONE ------------------
Node *head = new Node(3);
Node **p = &head;
*p = new Node(4);
1.a) printList(head);
4
1.b) printList(*p);
4
------------ LEVEL TWO ------------------
Node *head = new Node(3);
Node **p = &head;
*p = new Node(4);
*p = (*p)->next;
2.a) printList(head);
null
2.b) printList(*p);
null
------------ LEVEL THREE -----------------
Node *head = new Node(3);
Node **p = &head;
*p = new Node(4);
p = &((*p)->next);
*p = new Node(5);
3.a) printList(head);
4->5
3.b) printList(*p);
null
avatar
G*s
28
感谢你设计的题目帮我顺便又复习了一下,好玩!!
解pointer的题,要virtulize memory,脑子里就要生成一个像你画的那个图,这些题
就简单多了。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。