Modify Linked List-1 | Hindi | GFG POTD | C++ | Java | Linked List | Reverse List



Modify Linked List-1 | Hindi | GFG POTD | C++ | Java | Linked List | Reverse List

Modify Linked List-1 | Hindi | GFG POTD | C++ | Java | Linked List | Reverse List

Given a singly linked list containing N nodes. Modify the Linked list as follows:

1. Modify the value of the first half nodes such that 1st node’s new value is equal to the value of the last node minus the first node’s current value, 2nd node’s new value is equal to the second last nodes value minus 2nd nodes current value, likewise for first half nodes.
2. Replace the second half of nodes with the initial values of the first half nodes(values before modifying the nodes).
3. If N is odd then the value of the middle node remains unchanged.

0:00 Introduction
0:13 Problem Statement
1:04 White Board Explanation
9:53 Complexity Analysis
10:09 C++ Code
19:12 Java Code

My DSA Journey:- https://youtu.be/quZBBv12mCQ

How to Earn By GFG Articles:- https://youtu.be/XjvEgkd49Gk

Problem Link:-https://practice.geeksforgeeks.org/problems/modify-linked-list-1-0546/1

Code Link:-https://github.com/ShubhamKashyap138/Data-Structure/blob/main/Modify%20Linked%20List-1

Playlist Link:-https://youtube.com/playlist?list=PLq3GlRZI14Hui2ILGsfF1Uf2RnbNu9wT3

Linkedin:- https://www.linkedin.com/in/shubham-kashyap-65a29a218/

Instagram:- https://instagram.com/im_shubham_kashyap?igshid=YmMyMTA2M2Y=

My GFG Profile:- https://auth.geeksforgeeks.org/user/shubhamrajput6156/practice

gfg potd
gfg potd today
gfg problem of the day
potd gfg
potd
potd today
gfg

#dsa #datastructures #algorithm #gfg #potd #coding #array #strings #tree #binarysearchtree #codekarlo #dynamicprogramming

Comments are closed.