Rearrange a linked list such that all even and odd positioned nodes are together | GeeksforGeeks

  Рет қаралды 28,072

GeeksforGeeks

GeeksforGeeks

Күн бұрын

Пікірлер: 23
@FrankLi92
@FrankLi92 5 жыл бұрын
This code can be simplified for readability purposes. There is a lot of variable substitution, that doesn't need to be there.
@chinmayanand896
@chinmayanand896 8 жыл бұрын
your videos and explaination is too good please make more videos for me...........................
@piyushmajgawali1611
@piyushmajgawali1611 5 жыл бұрын
if odd is null ,how can you assign odd->next (IN THE FIRST CONDITION TO BREAK)
@pushp1997
@pushp1997 5 жыл бұрын
EXACTLY!
@jhannyvivek8549
@jhannyvivek8549 6 жыл бұрын
Well done Harshit Jain...Nicely explained
@venkateshnaidu2133
@venkateshnaidu2133 5 жыл бұрын
can we do this in O(1) space complexity?
@bendakai1
@bendakai1 5 жыл бұрын
Yes. Keep a pointer at head of the list and move runner pointer 2 nodes forward. detach the node and attach it at head. at eh end we will have all evens at start and odds at other end
@srinaath9845
@srinaath9845 4 жыл бұрын
@@bendakai1 nice bro
@arghadeep10
@arghadeep10 8 жыл бұрын
luv u harshit muaah ..dhanyabad bhai.
@GeeksforGeeksVideos
@GeeksforGeeksVideos 7 жыл бұрын
You're welcome, Arghadeep!
@spicytuna08
@spicytuna08 6 жыл бұрын
don't you have to read the data and identify whether or not it is odd or even? here, it seems like the input has to have even number and odd number alternate in order for it to work.
@cu7695
@cu7695 6 жыл бұрын
He's concerned about position not the exact nature of the data in the node.
@Shorts-gz3qk
@Shorts-gz3qk 3 жыл бұрын
How come 22 & 70 is odd?
@spicytuna08
@spicytuna08 6 жыл бұрын
use C++ list.erase() and list.push_back().
@reyou7
@reyou7 7 жыл бұрын
cool, good and nice!
@spicytuna08
@spicytuna08 6 жыл бұрын
need examples please. that is how most people learn.
@spicytuna08
@spicytuna08 6 жыл бұрын
1:12, output is wrong
@azazahmedtai5730
@azazahmedtai5730 4 жыл бұрын
he is talknig about positioning/index not about even or odd number
@aFang-xm9vu
@aFang-xm9vu 7 жыл бұрын
印度英语听得就是膈应
@ATULBP1998
@ATULBP1998 7 жыл бұрын
Google translator say "Indian English is the answer"
Check if a linked list is Circular Linked List | GeeksforGeeks
5:41
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 12 МЛН
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 23 МЛН
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
Delete N nodes after M nodes of a linked list | GeeksforGeeks
8:36
GeeksforGeeks
Рет қаралды 27 М.
Add 1 to a number represented as linked list | GeeksforGeeks
14:09
GeeksforGeeks
Рет қаралды 134 М.
How to Create a Linked List C++ Introduction to Linked Lists
12:24
Paul Programming
Рет қаралды 932 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 664 М.
Leetcode - Odd Even Linked List (Python)
7:15
Timothy H Chang
Рет қаралды 6 М.
Introduction to Linked Lists (Data Structures & Algorithms #5)
18:47
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 12 МЛН