Documentation
¶
Overview ¶
Package strategy is an example of the Strategy Pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides a context for execution of a strategy.
func (*Context) Algorithm ¶
func (c *Context) Algorithm(a StrategySort)
Algorithm replaces strategies.
type InsertionSort ¶
type InsertionSort struct {
}
InsertionSort implements insertion sort algorithm.
type StrategySort ¶
type StrategySort interface {
Sort([]int)
}
StrategySort provides an interface for sort algorithms.
Click to show internal directories.
Click to hide internal directories.