Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Convertable ¶
type Convertable interface {
Convert(s string) (FileRecord, error)
}
Convertable 是将文本转化为一条数据记录的工具
type FRecordSpace ¶
type FRecordSpace struct { N int // 最大记录数量 // contains filtered or unexported fields }
选择置换排序所用空间
func NewFRecordSpace ¶
func NewFRecordSpace(options ...FRecordSpaceOption) *FRecordSpace
type FRecordSpaceOption ¶
type FRecordSpaceOption func(*FRecordSpace)
func WithMaxRecordNum ¶
func WithMaxRecordNum(N int) FRecordSpaceOption
func WithTempPath ¶
func WithTempPath(path string) FRecordSpaceOption
type FileReader ¶
type FileReader interface { Read() (string, error) ChangeSource(source *os.File) Copy() FileReader }
FileReader 定义了从文件中读取文本, 且一次读取相当于一条记录的文本的方法
type FileRecord ¶
FileRecord 是从文件中读取到的文本转化为的数据记录, 一条记录必须满足: 1. 可排序(即, 可以与另一条记录比较大小) 2. 可转化为文本, 从而输出到结果文件中
type FileRecordHeap ¶
type FileRecordHeap []FileRecord
文件类型的小根堆
func (FileRecordHeap) Len ¶
func (frh FileRecordHeap) Len() int
func (FileRecordHeap) Less ¶
func (frh FileRecordHeap) Less(i, j int) bool
func (*FileRecordHeap) Pop ¶
func (frh *FileRecordHeap) Pop() interface{}
func (*FileRecordHeap) Push ¶
func (frh *FileRecordHeap) Push(x interface{})
func (FileRecordHeap) Swap ¶
func (frh FileRecordHeap) Swap(i, j int)
type MergeTreeNode ¶
MergeTreeNode 合并树节点
type RaceTree ¶
type RaceTree []FileRecord
func NewEmptyRaceTree ¶
func (RaceTree) Peak ¶
func (tree RaceTree) Peak() (FileRecord, int)
func (RaceTree) Put ¶
func (tree RaceTree) Put(record FileRecord, idx int)
Click to show internal directories.
Click to hide internal directories.