-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added Priority Queue #3971
added Priority Queue #3971
Conversation
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
Changes done |
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
}; | ||
|
||
class PriorityQueue { | ||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unindent the whole class body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
#include <cstdlib> | ||
|
||
// Node Declaration | ||
struct node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call this Node
.
code/data_structures/src/queue/priority_queue/priority_queue.cpp
Outdated
Show resolved
Hide resolved
std::cout << "Queue Underflow\n"; | ||
else { | ||
tmp = front; | ||
std::cout << "Removed item is: " << tmp->info << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
throw true; | ||
else { | ||
tmp = front; | ||
std::cout << "Removed item is: " << tmp->info << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am actually not clear why should I remove this ??
@Bhupesh-V waiting for your changes! |
Sorry I have been busy with college internals 😅 |
Fixes issue:
Changes:
README.md
file explaining Priority Queues.