I am not getting the y priority Q is getting used for this question, as in
case of P Queue, things are arranged as per the priority so when we will
insert the data we can simply increament the priority.
Algo would be like this :
Enque(q, data) {
push(q, data, increrase the prioroty);
}
int Deque() {
return pop();
}
here higher priority one shuld be poped first.
PLEASE SUGGEST if any good approach some one is having other than this ?
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].