Skip to content

Commit 6b4ab56

Browse files
committed
move files to package algs4
1 parent 72dd6c1 commit 6b4ab56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+201
-201
lines changed

README.md

+47-47

acyclic_sp.go algs4/acyclic_sp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// AcyclicSP ...
44
type AcyclicSP struct {

bag.go algs4/bag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"github.com/shellfly/algo/linklist"

bellman_ford_sp.go algs4/bellman_ford_sp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// BellmanFordSP ...
44
type BellmanFordSP struct {

binary_search_st.go algs4/binary_search_st.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
const initCapacity = 2
44

breadth_first_paths.go algs4/breadth_first_paths.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// BreadFirstPaths ...
44
type BreadFirstPaths struct {

bst.go algs4/bst.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// BSTNode ...
44
type BSTNode struct {

cc.go algs4/cc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// CC ...
44
type CC struct {

cycle.go algs4/cycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// Cycle ...
44
type Cycle struct {

depth_first_order.go algs4/depth_first_order.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// DepthFirstOrder ...
44
type DepthFirstOrder struct {

depth_first_paths.go algs4/depth_first_paths.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// DepthFirstPaths ...
44
type DepthFirstPaths struct {

depth_first_search.go algs4/depth_first_search.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// DepthFirstSearch ...
44
type DepthFirstSearch struct {

digraph.go algs4/digraph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"fmt"

dijkstra_sp.go algs4/dijkstra_sp.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// PositiveInfinity is a fake positive infinity value
44
const PositiveInfinity = 999999.0

directed_cycle.go algs4/directed_cycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// DirectedCycle ...
44
type DirectedCycle struct {

directed_dfs.go algs4/directed_dfs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// DirectedDFS ...
44
type DirectedDFS struct {

directed_edge.go algs4/directed_edge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "fmt"
44

edge.go algs4/edge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "fmt"
44

edge_weighted_digraph.go algs4/edge_weighted_digraph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"fmt"

edge_weighted_directed_cycle.go algs4/edge_weighted_directed_cycle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// EdgeWeightedDirectedCycle for EdgeWeightedDigrapy
44
// Note: this is file is just placeholder, see detail algorithm in directed_cycle.go

edge_weighted_graph.go algs4/edge_weighted_graph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"fmt"

ewd_topological.go algs4/ewd_topological.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// EWDTopological implements topological order for a edge weighted digraph
44
type EWDTopological struct {

graph.go algs4/graph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"fmt"

heap.go algs4/heap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
func sink(items SortInterface, k, N int) {
44
for 2*k <= N {

index_min_pq.go algs4/index_min_pq.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "fmt"
44

insertion.go algs4/insertion.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// InsertionSort ...
44
func InsertionSort(items SortInterface) {

kosaraju_scc.go algs4/kosaraju_scc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// KosarajuSCC ...
44
type KosarajuSCC struct {

kruskal_mst.go algs4/kruskal_mst.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// KruskalMST ...
44
type KruskalMST struct {

lazy_prim_mst.go algs4/lazy_prim_mst.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// LazyPrimMST ...
44
type LazyPrimMST struct {

linear_probing_hash_st.go algs4/linear_probing_hash_st.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// LinearProbingHashST is symbol table
44
type LinearProbingHashST struct {

max_pq.go algs4/max_pq.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// MaxPQ is a priority queue
44
type MaxPQ struct {

merge.go algs4/merge.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// this module only work for string slice
22

3-
package algo
3+
package algs4
44

55
func merge(items StringSlice, lo, mid, hi int) {
66
aux := make(StringSlice, len(items))

min_pq.go algs4/min_pq.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "fmt"
44

prim_mst.go algs4/prim_mst.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "fmt"
44

queue.go algs4/queue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"github.com/shellfly/algo/linklist"

quick.go algs4/quick.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"math/rand"

quick_3way.go algs4/quick_3way.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"math/rand"

red_black_bst.go algs4/red_black_bst.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
const (
44
red = true

selection.go algs4/selection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// SelectionSort ...
44
func SelectionSort(items SortInterface) {

separate_chaining_hash_st.go algs4/separate_chaining_hash_st.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// HashKey ...
44
type HashKey interface {

sequential_search_st.go algs4/sequential_search_st.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
type node struct {
44
key, val interface{}

shell.go algs4/shell.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// ShellSort ...
44
func ShellSort(items SortInterface) {

sort.go algs4/sort.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// SortInterface is borrow from go lib sort.Interface
44
type SortInterface interface {

st.go algs4/st.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
// Key is an interface of the key in ST
44
type Key interface {

stack.go algs4/stack.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import "github.com/shellfly/algo/linklist"
44

symbol_digraph.go algs4/symbol_digraph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"strings"

symbol_graph.go algs4/symbol_graph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package algo
1+
package algs4
22

33
import (
44
"strings"

0 commit comments

Comments
 (0)