feat(csharp) .NET 8.0 code migration (#966)

* .net 8.0 migration

* update docs

* revert change

* revert change and update appendix docs

* remove static

* Update binary_search_insertion.cs

* Update binary_search_insertion.cs

* Update binary_search_edge.cs

* Update binary_search_insertion.cs

* Update binary_search_edge.cs

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
hpstory
2023-11-26 23:18:44 +08:00
committed by GitHub
parent d960c99a1f
commit 56b20eff36
93 changed files with 539 additions and 487 deletions

View File

@ -8,7 +8,7 @@ namespace hello_algo.chapter_dynamic_programming;
public class edit_distance {
/* 编辑距离:暴力搜索 */
public int EditDistanceDFS(string s, string t, int i, int j) {
int EditDistanceDFS(string s, string t, int i, int j) {
// 若 s 和 t 都为空,则返回 0
if (i == 0 && j == 0)
return 0;
@ -30,7 +30,7 @@ public class edit_distance {
}
/* 编辑距离:记忆化搜索 */
public int EditDistanceDFSMem(string s, string t, int[][] mem, int i, int j) {
int EditDistanceDFSMem(string s, string t, int[][] mem, int i, int j) {
// 若 s 和 t 都为空,则返回 0
if (i == 0 && j == 0)
return 0;
@ -56,7 +56,7 @@ public class edit_distance {
}
/* 编辑距离:动态规划 */
public int EditDistanceDP(string s, string t) {
int EditDistanceDP(string s, string t) {
int n = s.Length, m = t.Length;
int[,] dp = new int[n + 1, m + 1];
// 状态转移:首行首列
@ -82,7 +82,7 @@ public class edit_distance {
}
/* 编辑距离:空间优化后的动态规划 */
public int EditDistanceDPComp(string s, string t) {
int EditDistanceDPComp(string s, string t) {
int n = s.Length, m = t.Length;
int[] dp = new int[m + 1];
// 状态转移:首行