Blogs Hub

by AskGif | Oct 16, 2020 | Category :coding

Number of Recent Calls - Queue - Easy - LeetCode

Number of Recent Calls - Queue - Easy - LeetCode

You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: RecentCounter() Initializes the counter with zero recent requests.<br />int ping(int t) Adds a new request at time t, where t represents some tim

read more...

by AskGif | Jan 03, 2019 | Category :coding

What is a Priority Queue?

What is a Priority Queue?

In computer science, a priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. In some

read more...

by AskGif | Aug 08, 2018 | Category :coding

What is a Queue?

What is a Queue?

A queue is a data structure used for storing data (similar to Linked Lists and Stacks). In a queue, the order in which data arrives is important. In general, a queue is a line of people or things waiting to be served in sequential order starting at the beginning of the line or sequence. A

read more...

by AskGif | Jul 16, 2018 | Category :coding

Find the smallest sub array with a sum greater than a given number.

Find the smallest sub array with a sum greater than a given number.

You are given an array of integers and a particular number, you need to find the smallest subarray possible with a sum greater than the given Number. The requirement is to write an algorithm that calculates in Time Complexity of O(n). Java Solution of the given problem is : <pre clas

read more...