0
点赞
收藏
分享

微信扫一扫

[AHK]数据结构Queue和Stack


# FIFO

/**
*用AutoHotkey_L实现的Queue类
*@Author sunwind(1576157)
*/
; FIFO
qlist := new Queue
qlist.Push("Hello")
qlist.Push("World")
MsgBox % qlist.Pop(1) qlist.Pop(1)


class Queue
{
    _StaticInit()
    {
        global Queue
        static _ := Queue._StaticInit()
        this.Push := Func("ObjInsert")
        this.Pop  := Func("ObjRemove")
    }
}

# FILO

/**
*用AutoHotkey_L实现的 Stack类
*@Author sunwind(1576157)
*/
S:= new Stack
S.Push("Hello")
S.Push("World")
MsgBox % S.Pop() S.Pop()


class Stack
{
    _StaticInit()
    {
        global Stack
        static _ := Stack._StaticInit()
        this.Push := Func("ObjInsert")
        this.Pop  := Func("ObjRemove")
    }
}

举报

相关推荐

0 条评论