mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-20 18:46:06 +00:00
fix(csharp): Modify method name to PascalCase, simplify new expression (#840)
* Modify method name to PascalCase(array and linked list) * Modify method name to PascalCase(backtracking) * Modify method name to PascalCase(computational complexity) * Modify method name to PascalCase(divide and conquer) * Modify method name to PascalCase(dynamic programming) * Modify method name to PascalCase(graph) * Modify method name to PascalCase(greedy) * Modify method name to PascalCase(hashing) * Modify method name to PascalCase(heap) * Modify method name to PascalCase(searching) * Modify method name to PascalCase(sorting) * Modify method name to PascalCase(stack and queue) * Modify method name to PascalCase(tree) * local check
This commit is contained in:
@@ -158,9 +158,9 @@
|
||||
```csharp title="heap.cs"
|
||||
/* 初始化堆 */
|
||||
// 初始化小顶堆
|
||||
PriorityQueue<int, int> minHeap = new PriorityQueue<int, int>();
|
||||
PriorityQueue<int, int> minHeap = new();
|
||||
// 初始化大顶堆(使用 lambda 表达式修改 Comparator 即可)
|
||||
PriorityQueue<int, int> maxHeap = new PriorityQueue<int, int>(Comparer<int>.Create((x, y) => y - x));
|
||||
PriorityQueue<int, int> maxHeap = new(Comparer<int>.Create((x, y) => y - x));
|
||||
|
||||
/* 元素入堆 */
|
||||
maxHeap.Enqueue(1, 1);
|
||||
@@ -394,11 +394,11 @@
|
||||
=== "C#"
|
||||
|
||||
```csharp title="my_heap.cs"
|
||||
[class]{MaxHeap}-[func]{left}
|
||||
[class]{MaxHeap}-[func]{Left}
|
||||
|
||||
[class]{MaxHeap}-[func]{right}
|
||||
[class]{MaxHeap}-[func]{Right}
|
||||
|
||||
[class]{MaxHeap}-[func]{parent}
|
||||
[class]{MaxHeap}-[func]{Parent}
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@@ -506,7 +506,7 @@
|
||||
=== "C#"
|
||||
|
||||
```csharp title="my_heap.cs"
|
||||
[class]{MaxHeap}-[func]{peek}
|
||||
[class]{MaxHeap}-[func]{Peek}
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@@ -619,9 +619,9 @@
|
||||
=== "C#"
|
||||
|
||||
```csharp title="my_heap.cs"
|
||||
[class]{MaxHeap}-[func]{push}
|
||||
[class]{MaxHeap}-[func]{Push}
|
||||
|
||||
[class]{MaxHeap}-[func]{siftUp}
|
||||
[class]{MaxHeap}-[func]{SiftUp}
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
@@ -757,9 +757,9 @@
|
||||
=== "C#"
|
||||
|
||||
```csharp title="my_heap.cs"
|
||||
[class]{MaxHeap}-[func]{pop}
|
||||
[class]{MaxHeap}-[func]{Pop}
|
||||
|
||||
[class]{MaxHeap}-[func]{siftDown}
|
||||
[class]{MaxHeap}-[func]{SiftDown}
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
=== "C#"
|
||||
|
||||
```csharp title="top_k.cs"
|
||||
[class]{top_k}-[func]{topKHeap}
|
||||
[class]{top_k}-[func]{TopKHeap}
|
||||
```
|
||||
|
||||
=== "Go"
|
||||
|
||||
Reference in New Issue
Block a user