Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Example_priorityQueue (0.18 sec)

  1. src/container/heap/example_pq_test.go

    	item.priority = priority
    	heap.Fix(pq, item.index)
    }
    
    // This example creates a PriorityQueue with some items, adds and manipulates an item,
    // and then removes the items in priority order.
    func Example_priorityQueue() {
    	// Some items and their priorities.
    	items := map[string]int{
    		"banana": 3, "apple": 2, "pear": 4,
    	}
    
    	// Create a priority queue, put the items in it, and
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:27:36 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top