|
|
@ -38,7 +38,7 @@ comments: true
|
|
|
|
Node(int x) { val = x; }
|
|
|
|
Node(int x) { val = x; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 函数(或称方法) */
|
|
|
|
/* 函数 */
|
|
|
|
int function() {
|
|
|
|
int function() {
|
|
|
|
// do something...
|
|
|
|
// do something...
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -63,7 +63,7 @@ comments: true
|
|
|
|
Node(int x) : val(x), next(nullptr) {}
|
|
|
|
Node(int x) : val(x), next(nullptr) {}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* 函数(或称方法) */
|
|
|
|
/* 函数 */
|
|
|
|
int func() {
|
|
|
|
int func() {
|
|
|
|
// do something...
|
|
|
|
// do something...
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -87,7 +87,7 @@ comments: true
|
|
|
|
self.val = x # 结点值
|
|
|
|
self.val = x # 结点值
|
|
|
|
self.next = None # 指向下一结点的指针(引用)
|
|
|
|
self.next = None # 指向下一结点的指针(引用)
|
|
|
|
|
|
|
|
|
|
|
|
""" 函数(或称方法) """
|
|
|
|
""" 函数 """
|
|
|
|
def function():
|
|
|
|
def function():
|
|
|
|
# do something...
|
|
|
|
# do something...
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
@ -113,7 +113,7 @@ comments: true
|
|
|
|
return &Node{val: val}
|
|
|
|
return &Node{val: val}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 函数(或称方法)*/
|
|
|
|
/* 函数 */
|
|
|
|
func function() int {
|
|
|
|
func function() int {
|
|
|
|
// do something...
|
|
|
|
// do something...
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
@ -157,7 +157,7 @@ comments: true
|
|
|
|
Node(int x) { val = x; }
|
|
|
|
Node(int x) { val = x; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 函数(或称方法) */
|
|
|
|
/* 函数 */
|
|
|
|
int function()
|
|
|
|
int function()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// do something...
|
|
|
|
// do something...
|
|
|
|