What happens if we rearrange a linked list by odd and even indices?
Letβs find out by solving LeetCode 328 β Odd Even Linked List in C++.
This problem is a great exercise for understanding pointer manipulation, list traversal, and in-place restructuring β all in a single clean algorithm.
What youβll learn
β How to separate nodes into odd and even groups efficiently
β How to rearrange pointers in a single pass
β How to reconnect lists cleanly in C++
Time complexity: O(n)
Space complexity: O(1)
β±οΈ Timestamps
0:00 β Problem explanation
0:40 β Example walkthrough
1:40 β Odd-even logic explained
3:00 β Full C++ solution
4:00 β Wrap-up and insights
Watch the full LeetCode 75 Series in C++
https://www.youtube.com/playlist?list=PLF0G-7pZcOza_jyAxwMpa5KnK3vST5smK
Continue this lesson in the app
Install CourseHive on Android or iOS to keep learning while you move.
FAQs
We curate free YouTube courses, organized by category and language β and make it easy for you to track your learning progress.
Yes. Free courses are embedded YouTube videos.
Currently available in English β with Portuguese, Spanish, French, German, and Italian coming soon.
Check ratings, reviews, duration, and description.
All courses include a certificate of participation.
Yes, an account lets you track progress, earn certificates, and save favorites.
We auto-save your watch position so you can resume on any device.