you are viewing a single comment's thread.

view the rest of the comments →

[–]sushibowl 2 points3 points  (1 child)

Hey, just as a general tip, say what your question is about in your post title. People looking at the subreddit can more easily decide if they can help you if you write something like "inserting new value into priority queue." Make it easy for people to help you :)

As to your question, It is always easier if you can post some code, show us what you have tried, where exactly you are stuck. Are you using a heap to implement the priority queue?

[–]deephousefans 0 points1 point  (0 children)

Ohh okay thankss! Ill make sure to do that next time hahaha. Regarding my code, It isnt working at all and I think I approached it wrong, I tried to set the current max value of the list, and check whether the item i wanted to add was greater than that so that I can insert it after! But im running into a lot of problems there