This commit is contained in:
sujit
2025-09-18 18:26:35 +05:45
parent 1b3ebcc325
commit 33857e32d1
55 changed files with 757 additions and 896 deletions

View File

@@ -96,13 +96,13 @@ func (pq PriorityQueue) Swap(i, j int) {
pq[i].index = i
pq[j].index = j
}
func (pq *PriorityQueue) Push(x interface{}) {
func (pq *PriorityQueue) Push(x any) {
n := len(*pq)
task := x.(*QueueTask)
task.index = n
*pq = append(*pq, task)
}
func (pq *PriorityQueue) Pop() interface{} {
func (pq *PriorityQueue) Pop() any {
old := *pq
n := len(old)
task := old[n-1]