mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 15:06:07 +00:00
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:
@@ -8,7 +8,7 @@ namespace hello_algo.chapter_hashing;
|
||||
|
||||
public class simple_hash {
|
||||
/* 加法哈希 */
|
||||
public static int AddHash(string key) {
|
||||
int AddHash(string key) {
|
||||
long hash = 0;
|
||||
const int MODULUS = 1000000007;
|
||||
foreach (char c in key) {
|
||||
@@ -18,7 +18,7 @@ public class simple_hash {
|
||||
}
|
||||
|
||||
/* 乘法哈希 */
|
||||
public static int MulHash(string key) {
|
||||
int MulHash(string key) {
|
||||
long hash = 0;
|
||||
const int MODULUS = 1000000007;
|
||||
foreach (char c in key) {
|
||||
@@ -28,7 +28,7 @@ public class simple_hash {
|
||||
}
|
||||
|
||||
/* 异或哈希 */
|
||||
public static int XorHash(string key) {
|
||||
int XorHash(string key) {
|
||||
int hash = 0;
|
||||
const int MODULUS = 1000000007;
|
||||
foreach (char c in key) {
|
||||
@@ -38,7 +38,7 @@ public class simple_hash {
|
||||
}
|
||||
|
||||
/* 旋转哈希 */
|
||||
public static int RotHash(string key) {
|
||||
int RotHash(string key) {
|
||||
long hash = 0;
|
||||
const int MODULUS = 1000000007;
|
||||
foreach (char c in key) {
|
||||
|
||||
Reference in New Issue
Block a user