New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/akl773/strategic-heap-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/akl773/strategic-heap-go

  • v0.0.0-20230622190032-e8eb1bbd4d8f
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go-Strategic-Heap

Go-Strategic-Heap is a powerful and efficient Go library that implements heap data structures. It provides support for both min-heap and max-heap strategies, making it an ideal choice for projects that require priority queues or heap sorts. With its simple API and high-performance operations, Strategic-Heap-Go makes it easy to create and manipulate heaps.

Features

  • Easy-to-use API
  • Support for both min-heap and max-heap strategies
  • High-performance operations

Installation

To install Strategic-Heap-Go, use the go get command:

go get github.com/akl773/Strategic-Heap-Go/heap

Usage Here's a simple example that demonstrates how to use the library:

package main

import (
	"fmt"
	"github.com/akl773/Strategic-Heap-Go/heap"
)

func main() {
	h := heap.NewMinHeap()

	for i := 5; i > 0; i-- {
		h.Push(i)
	}

	for h.Len() != 0 {
		fmt.Println(h.Pop())
	}
}

This program creates a min heap, pushes some integers onto it, and then pops them off. When executed, it will print the integers 1 through 5 in ascending order.

Testing

You can run the tests using the go test command:

go test

Contributing

Pull requests are welcome. If you plan to make major changes, please open an issue first to discuss what you would like to change.

Please ensure that you update the tests as appropriate.

FAQs

Package last updated on 22 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc