newszine

Design Queue using Linked List | Queue Problem | Java with Generics

4 years ago Lalit Bhagtani 0
Problem Statement Design a Queue (FIFO) data structure using Linked List. The Queue data structure will supports the following operations: enqueue(N) :- It insert element N to the back of the queue. dequeue() :- It removes and returns the element from the front of the queue. peek() :- It returns (not remove) the element from Read More

Design Stack using Linked List | Stack Problem | Java with Generics

4 years ago Lalit Bhagtani 0
Problem Statement Design a Stack (LIFO) data structure using Linked List. The Stack data structure will supports the following operations: push(N) :- It insert element N onto the top of the stack. pop() :- It removes and returns the element from the top of the stack. peek() :- It returns (not remove) the element from Read More

Partition a Linked List | Linked List Problem | LeetCode 86

4 years ago Lalit Bhagtani 0
Problem Statement You have given a singly linked list and an integer value X. Partition the given linked list in such a way that all nodes whose value is less than X come before the nodes whose values are greater than or equal to X. Example  Input :- head = Read More

Flatten a Multilevel Doubly Linked List | LeetCode 430

4 years ago Lalit Bhagtani 1
Problem Statement You have given a doubly linked list which in addition to the next and previous pointers, it also has a child pointer, which may or may not point to a separate doubly linked list. These child lists may have one or more children of their own, and so on, to produce a multilevel Read More