Created
September 6, 2017 23:50
-
-
Save bgadrian/963a4fab25bef812bb659af77b5883e4 to your computer and use it in GitHub Desktop.
Go example for my hierarchical queue structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/BTooLs/data-structures/priorityqueue" | |
) | |
func main() { | |
autoLockMutex := false | |
var lowestPriority uint8 = 10 //highest is 0 | |
l := priorityqueue.NewHierarchicalQueue(lowestPriority, autoLockMutex) | |
l.Enqueue("a", 8) | |
l.Enqueue("b", 1) | |
first, _ := l.Dequeue() | |
fmt.Printf("first is %v", first) | |
// Output: first is b | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment