I am learning heap and was introduced to something called "sentinel element"as you can see “None” in the list.
I am not sure what it is, and more importantly, what it does and what happens if I don’t use the sentinel element. And I also encountered something called “sentinel node.” Do they share a same concept?
class MinHeap: def __init__(self): self.heap_list = [None] self.count = 0
You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!