mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 22:46:28 +08:00
Merge branch 'krahets:master' into master
This commit is contained in:
commit
4e95997386
4 changed files with 9 additions and 9 deletions
|
@ -42,7 +42,7 @@ func printTree(root *TreeNode) {
|
|||
printTree(root.right)
|
||||
}
|
||||
|
||||
/* 函数(或称方法)*/
|
||||
/* 函数 */
|
||||
func function() int {
|
||||
// do something...
|
||||
return 0
|
||||
|
|
|
@ -38,7 +38,7 @@ comments: true
|
|||
Node(int x) { val = x; }
|
||||
}
|
||||
|
||||
/* 函数(或称方法) */
|
||||
/* 函数 */
|
||||
int function() {
|
||||
// do something...
|
||||
return 0;
|
||||
|
@ -63,7 +63,7 @@ comments: true
|
|||
Node(int x) : val(x), next(nullptr) {}
|
||||
};
|
||||
|
||||
/* 函数(或称方法) */
|
||||
/* 函数 */
|
||||
int func() {
|
||||
// do something...
|
||||
return 0;
|
||||
|
@ -87,7 +87,7 @@ comments: true
|
|||
self.val = x # 结点值
|
||||
self.next = None # 指向下一结点的指针(引用)
|
||||
|
||||
""" 函数(或称方法) """
|
||||
""" 函数 """
|
||||
def function():
|
||||
# do something...
|
||||
return 0
|
||||
|
@ -113,7 +113,7 @@ comments: true
|
|||
return &Node{val: val}
|
||||
}
|
||||
|
||||
/* 函数(或称方法)*/
|
||||
/* 函数 */
|
||||
func function() int {
|
||||
// do something...
|
||||
return 0
|
||||
|
@ -157,7 +157,7 @@ comments: true
|
|||
Node(int x) { val = x; }
|
||||
}
|
||||
|
||||
/* 函数(或称方法) */
|
||||
/* 函数 */
|
||||
int function()
|
||||
{
|
||||
// do something...
|
||||
|
|
|
@ -453,7 +453,7 @@ comments: true
|
|||
```js title=""
|
||||
/* 二叉树的数组表示 */
|
||||
// 直接使用 null 来表示空位
|
||||
let tree = [1, 2, 3, 4, 5, 6, 7, null, null, null, null, null, null, null, null]
|
||||
let tree = [1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15];
|
||||
```
|
||||
|
||||
=== "TypeScript"
|
||||
|
@ -461,7 +461,7 @@ comments: true
|
|||
```typescript title=""
|
||||
/* 二叉树的数组表示 */
|
||||
// 直接使用 null 来表示空位
|
||||
let tree = [1, 2, 3, 4, 5, 6, 7, null, null, null, null, null, null, null, null]
|
||||
let tree: (number | null)[] = [1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15];
|
||||
```
|
||||
|
||||
=== "C"
|
||||
|
|
Loading…
Reference in a new issue