Organizing all the code blocks.

This commit is contained in:
Yudong Jin
2022-12-03 01:31:29 +08:00
parent fec56afd5f
commit 9bd5980a81
21 changed files with 2520 additions and 310 deletions

View File

@@ -44,6 +44,42 @@ comments: true
}
```
=== "Python"
```python title="linear_search.py"
```
=== "Go"
```go title="linear_search.go"
```
=== "JavaScript"
```js title="linear_search.js"
```
=== "TypeScript"
```typescript title="linear_search.ts"
```
=== "C"
```c title="linear_search.c"
```
=== "C#"
```csharp title="linear_search.cs"
```
再比如,我们想要在给定一个目标结点值 `target` ,返回此结点对象,也可以在链表中进行线性查找。
=== "Java"
@@ -80,6 +116,42 @@ comments: true
}
```
=== "Python"
```python title="linear_search.py"
```
=== "Go"
```go title="linear_search.go"
```
=== "JavaScript"
```js title="linear_search.js"
```
=== "TypeScript"
```typescript title="linear_search.ts"
```
=== "C"
```c title="linear_search.c"
```
=== "C#"
```csharp title="linear_search.cs"
```
## 复杂度分析
**时间复杂度 $O(n)$ ** 其中 $n$ 为数组或链表长度。