re: Writing a Minimum-Heap in Python3 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: This was a student of mine's homework project. His professor's specifications required the Heap to store Node objects with key-values on them. I un...
 

If you have to store keys and values, all you do is (in C# using my example) this:

Heap<(KeyType, ValueType)>

So there should only ever be one generic type, even if you need to store multiple values, you just pass in a type with multiple values.

Just wanted to clarify that. Let me know if that doesn't make sense and I will gladly elaborate.

But yeah. Hope the student had fun figuring out the algorithms of a heap. :)

Yeah, your template looks a lot like the templating stuff I'd use in C++ and Java (I don't know C# but I understand it is similar enough).

We both had fun working through the methods :D It is definitely good practice.

code of conduct - report abuse