Day 22 — Queue using List

Day 22 — Queue using List

100 Days to Amazon

Image for post

Image by Richard Mcall from Pixabay

*100 Days to Amazon — *Day 22 — Queue using List

Out of Free Stories? Here is myFriend Link.

Hey Guys, Today is day 22 **of the challenge that I took. Wherein I will be solving every day for 100 days the [programming questions](https://medium.com/hackernoon/50-data-structure-and-algorithms-interview-questions-for-programmers-b4b1ac61f5b0) that have been asked in previous interviews.**

You have a bonus at the end if you keep reading. You can find out the companies that have asked these questions in real interviews.

All these problems are taken from the following [e-book_](https://www.amazon.com/dp/B081969QH5/ref=cm_sw_r_cp_apa_i_wqVZDbCVY8RV6). 🎓_

This is completely free 🆓 if you have an amazon kindle subscription.

This e-book contains 100 coding problems that have been asked in top tech interview questions. It also has a guide to solving all the problems in 200+ ways. **These problems I assure you** has been asked in previous interviews.

You have to decide whether you want to go** unprepared *for a tech interview or go ahead and **quick search for this guide *to solve the 100 problems.

Begin Your ascent to greatness🚀

Note :_ this e-book only contains the _links __to the__solutions.

Day 22- Queue using Linked List

AIM🏹

To Implement a Q using LinkedList.

You need to implement** an enqueue** and** dequeue **function.

When *getHeadOfLinkedList *is called, return the *head *of the linked list.

When enqueue is called, insert the items in the list at the head.

When the Q is empty and** dequeue** is called return 0.

When the Q is empty, GetMax and GetMin *should return *0.

GetMin should return the MIN element **in the Qand it should NOT** remove the element out.

Example

ENQUEUE 4 ENQUEUE 6 ENQUEUE 8 DEQUEUE

**GETMAX **should return:** 6**

Code👇

Author: Akshay Ravindran

Explanation🦅

This is a *basic linked list *concept that is used to create a queue data structure.

*Queue *by default works based on the** first come first serve strategy(FIFO).**

When a** data element is inserted a node is created and it is **inserted to the tail of the existing list if there is a list already.

If there is no existing list the node is created and made as to the** head **of the list.

Enqueue *function adds a node to the list and the *dequeue function removes the top element from the** lists.**

If there are no elements in the list then the** dequeue function returns 0 **as the result.

software-development java programming coding problem-solving

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Offshore Software Development - Best Practices

To make the most out of the benefits of offshore software development, you should understand the crucial factors that affect offshore development.

How to do Problem Solving as a Developer

In this video, I will be talking about problem-solving as a developer 🔴 Subscribe for more https://www.youtube.com/channel/UCMA8gVyu_IkVIixXd2p18NQ?sub_confi...

5 Core Criteria for Selecting Software Development Company - TopDevelopers.co

Check out these five criteria for the selection of your software vendor, and you will never regret having the wrong quality product made for you.

3 Best Programming Languages for Java Developers

In this article, I’ll share 3 JVM Programming languages Java programmers can learn and why you should learn them. Being a Polyglot developer is of good quality and often valued highly in interviews.

How to Install OpenJDK 11 on CentOS 8

What is OpenJDK? OpenJDk or Open Java Development Kit is a free, open-source framework of the Java Platform, Standard Edition (or Java SE).