fix(csharp): reformat csharp codes and docs (#652)

* fix(csharp): reformat the C# codes and docs

* Update time_complexity.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
hpstory
2023-07-24 19:50:00 +08:00
committed by GitHub
parent 1777a16865
commit 978d3c2ed7
13 changed files with 47 additions and 77 deletions

View File

@@ -111,8 +111,7 @@
```csharp title=""
/* 链表节点类 */
class ListNode
{
class ListNode {
int val; // 节点值
ListNode next; // 指向下一节点的引用
ListNode(int x) => val = x; //构造函数

View File

@@ -539,15 +539,13 @@
```csharp title="list.cs"
/* 通过索引遍历列表 */
int count = 0;
for (int i = 0; i < list.Count(); i++)
{
for (int i = 0; i < list.Count; i++) {
count++;
}
/* 直接遍历列表元素 */
count = 0;
foreach (int n in list)
{
foreach (int n in list) {
count++;
}
```