Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Odd Even Linked List

Description

Flashcards on Odd Even Linked List, created by Suhas S on 18/02/2018.
Suhas S
Flashcards by Suhas S, updated more than 1 year ago
Suhas S
Created by Suhas S over 7 years ago
1
0
1 2 3 4 5 (0)

Resource summary

Question Answer
Odd Even Linked List Even nodes at the end Odd nodes at the beginning public ListNode oddEvenList(ListNode head) { if (head != null) { ListNode odd = head, even = head.next, evenHead = even; while (even != null && even.next != null) { odd.next = odd.next.next; even.next = even.next.next; odd = odd.next; even = even.next; } odd.next = evenHead; } return head;
Show full summary Hide full summary

0 comments

There are no comments, be the first and leave one below:

Similar

Delete a node with a key
Suhas S
Delete Node in a BST
Suhas S
Remove Nth Node From End of List
Suhas S
Swap Nodes in Pairs
Suhas S
Merge Two Sorted Lists
Suhas S
Rotate List
Suhas S
Add Two Numbers
Suhas S
Copy List with Random Pointer
Suhas S
PE 1 Multi Choice Questions
Cath Warriner
OCR Gateway Biology Flash Cards
Sam Newey