mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-16 08:56:05 +00:00
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:
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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,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)
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace hello_algo.chapter_searching;
|
||||
namespace hello_algo.chapter_binary_search;
|
||||
|
||||
public class binary_search
|
||||
{
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace hello_algo.chapter_computational_complexity;
|
||||
namespace hello_algo.chapter_searching;
|
||||
|
||||
public class leetcode_two_sum
|
||||
{
|
||||
+1
-1
@@ -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 {
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Created Time: 2022-12-05
|
||||
// Author: Slone123c (274325721@qq.com)
|
||||
|
||||
package chapter_searching
|
||||
package chapter_binary_search
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
+1
-1
@@ -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 {
|
||||
+1
-1
@@ -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.*;
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
|
||||
package chapter_searching;
|
||||
package chapter_binary_search;
|
||||
|
||||
public class binary_search {
|
||||
/* 二分查找(双闭区间) */
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* Author: Krahets (krahets@163.com)
|
||||
*/
|
||||
|
||||
package chapter_computational_complexity;
|
||||
package chapter_searching;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
-1
@@ -62,4 +62,3 @@ pub fn main() !void {
|
||||
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user