## Priority Queue using doubly linked list

Given Nodes with their priority, implement a priority queue using doubly linked list. Prerequisite : Priority Queue Operations on Priority Queue : push(): This function… Read More »

Given Nodes with their priority, implement a priority queue using doubly linked list. Prerequisite : Priority Queue Operations on Priority Queue : push(): This function… Read More »

Implement Priority Queue using Linked Lists. Operations on Priority Queue : push(): This function is used to insert a new data into the queue. pop():… Read More »

A simple python List can act as queue and stack as well. Queue mechanism is used widely and for many purposes in daily life. A… Read More »

Deque also known as double eneded queue, as name suggests is a special kind of queue in which insertions and deletions can be done at… Read More »

Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More »

Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends. In previous post Implementation… Read More »

Given a queue of integers of even length, rearrange the elements by interleaving the first half of the queue with the second half of the… Read More »

Give an algorithm for reversing a queue Q. Only following standard operations are allowed on queue. enqueue(x) : Add an item x to rear of… Read More »

Given an integer k and a queue of integers, we need to reverse the order of the first k elements of the queue, leaving the… Read More »

Given two n-ary trees, the task is to check if they are mirror of each other or not. Print “Yes” if they are mirror of… Read More »

Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example: Tree 1: Level 0… Read More »

A stack permutation is a permutation of objects in the given input queue which is done by transferring elements from input queue to the output… Read More »

Given a non-empty binary tree, print the average value of the nodes on each level. Examples: Input : 4 / \ 2 9 / \… Read More »

Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream. Examples: Input… Read More »

Prerequisite : Page Replacement Algorithms In operating systems that use paging for memory management, page replacement algorithm are needed to decide which page needed to… Read More »