Skip to content

Golang translations of Robert Sedgewick's Java Algorthms.

Notifications You must be signed in to change notification settings

yinyajun/Algs-4-Golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algs-4-Golang

Algs-4-Golang is Golang port of the Java code in textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

It uses go module feature, make sure golang version >= 1.13.

Package Structure

Algs-4-Golang has clear structure.

  • abstract: API(interface) for abstract data structure.
  • impl: Implementation(source code & test cases) of abstract data structure.
  • utils: Useful tools to support test and debug.

Walk through impl, implemented algorithms organized in 6 sub-files corresponding to 6 chapters in Algs4 textbook.

  • impl/fundamentals
  • impl/sorting
  • impl/searching
  • impl/graphs
  • impl/strings
  • impl/context

Test Cases

Test cases in a examples file. Here is a simple usage to test interface Stack stated in abstract/stack.go

go run impl/fundamentals/examples/stack.go LinkedStack < data/tobe.txt

Algorithms Index

1. Fundamentals

Abstract Data Structure Implementation
Bag LinkedBag
ResizingArrayBag
Stack LinkedStack
ResizeArrayStack
Queue LinkedQueue
ResizingArrayQueue
Union-find QuickFindUF
QuickUnionUF
QuickUnionSizeUF
QuickUnionRankUF
QuickUnionCompressedUF
QuickUnionCompressedUF2

2. Sorting

Abstract Data Structure Implementation
Sorter(basic) Selection
Insertion
Advanced Insertion
Shell
Sorter(advanced) Merge
MergeBU
Advanced Merge
Quick
ThreeWayQuick
AdvancedQuick
Heap

3. Searching

Abstract Data Structure Implementation
SortedSymbolTable BinarySearchST
bstST
bstST_NotRecursive
SymbolTable SequentialSearchST
HashTableST
Traverse PreOrder
InOrder
PostOrder

About

Golang translations of Robert Sedgewick's Java Algorthms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published