Refactor the articles related to searching algorithm. Add the chapter of binary search. Add the section of searching algorithm revisited. (#464)

This commit is contained in:
Yudong Jin
2023-04-17 18:22:18 +08:00
committed by GitHub
parent 28fdd26f2f
commit 881d573790
57 changed files with 265 additions and 505 deletions
+2 -3
View File
@@ -8,8 +8,7 @@ include_directories(./include)
add_subdirectory(include)
add_subdirectory(chapter_computational_complexity)
add_subdirectory(chapter_array_and_linkedlist)
add_subdirectory(chapter_sorting)
add_subdirectory(chapter_tree)
add_subdirectory(chapter_stack_and_queue)
add_subdirectory(chapter_binary_search)
add_subdirectory(chapter_heap)
add_subdirectory(chapter_searching)
add_subdirectory(chapter_searching)
@@ -0,0 +1 @@
add_executable(linear_search linear_search.c)
@@ -1,4 +1,3 @@
add_executable(time_complexity time_complexity.c)
add_executable(worst_best_time_complexity worst_best_time_complexity.c)
add_executable(leetcode_two_sum leetcode_two_sum.c)
add_executable(space_complexity space_complexity.c)
+2 -3
View File
@@ -1,3 +1,2 @@
add_executable(binary_search binary_search.c )
add_executable(linear_search linear_search.c)
add_executable(hashing_search hashing_search.c)
add_executable(binary_search binary_search.c)
add_executable(leetcode_two_sum leetcode_two_sum.c)
+1
View File
@@ -8,6 +8,7 @@ include_directories(./include)
add_subdirectory(chapter_computational_complexity)
add_subdirectory(chapter_array_and_linkedlist)
add_subdirectory(chapter_stack_and_queue)
add_subdirectory(chapter_binary_search)
add_subdirectory(chapter_hashing)
add_subdirectory(chapter_tree)
add_subdirectory(chapter_heap)
@@ -0,0 +1 @@
add_executable(binary_search binary_search.cpp)
@@ -1,4 +1,3 @@
add_executable(leetcode_two_sum leetcode_two_sum.cpp)
add_executable(space_complexity space_complexity.cpp )
add_executable(space_complexity space_complexity.cpp)
add_executable(time_complexity time_complexity.cpp)
add_executable(worst_best_time_complexity worst_best_time_complexity.cpp)
+1 -1
View File
@@ -1,3 +1,3 @@
add_executable(binary_search binary_search.cpp)
add_executable(hashing_search hashing_search.cpp)
add_executable(leetcode_two_sum leetcode_two_sum.cpp)
add_executable(linear_search linear_search.cpp)
@@ -6,7 +6,7 @@
using NUnit.Framework;
namespace hello_algo.chapter_searching;
namespace hello_algo.chapter_binary_search;
public class binary_search
{
@@ -6,7 +6,7 @@
using NUnit.Framework;
namespace hello_algo.chapter_computational_complexity;
namespace hello_algo.chapter_searching;
public class leetcode_two_sum
{
@@ -2,7 +2,7 @@
// Created Time: 2022-12-05
// Author: Slone123c (274325721@qq.com)
package chapter_searching
package chapter_binary_search
/* 二分查找(双闭区间) */
func binarySearch(nums []int, target int) int {
@@ -2,7 +2,7 @@
// Created Time: 2022-12-05
// Author: Slone123c (274325721@qq.com)
package chapter_searching
package chapter_binary_search
import (
"fmt"
@@ -2,7 +2,7 @@
// Created Time: 2022-11-25
// Author: reanon (793584285@qq.com)
package chapter_computational_complexity
package chapter_searching
/* 方法一:暴力枚举 */
func twoSumBruteForce(nums []int, target int) []int {
@@ -2,7 +2,7 @@
// Created Time: 2022-11-25
// Author: reanon (793584285@qq.com)
package chapter_computational_complexity
package chapter_searching
import (
"fmt"
@@ -4,6 +4,8 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_backtracking;
import include.*;
import java.util.*;
@@ -4,6 +4,8 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_backtracking;
import include.*;
import java.util.*;
@@ -4,6 +4,8 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_backtracking;
import include.*;
import java.util.*;
@@ -4,6 +4,8 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_backtracking;
import include.*;
import java.util.*;
@@ -4,7 +4,7 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_searching;
package chapter_binary_search;
public class binary_search {
/* 二分查找(双闭区间) */
@@ -4,7 +4,7 @@
* Author: Krahets (krahets@163.com)
*/
package chapter_computational_complexity;
package chapter_searching;
import java.util.*;
@@ -62,4 +62,3 @@ pub fn main() !void {
_ = try std.io.getStdIn().reader().readByte();
}