# Documentation

## **ODD AFTER EVEN**

Asked in:  <a><img src= "https://img.shields.io/badge/-Amazon-red" height="25">&nbsp;&nbsp;
<img src= "https://img.shields.io/badge/-GeekforGeeks-darkgreen">&nbsp;&nbsp;
<img src= "https://img.shields.io/badge/-CPP-brown">&nbsp;&nbsp;


### Problem Statement 

Given a Linked List of integers, write a function to modify the linked list such that all even numbers appear before all the odd numbers in the modified linked list. Also, keep the order of even and odd numbers same.

**Constraints:**

            1 ≤ N ≤ 100
            1 ≤ size of elements ≤ 1000


**Example 1 :**

       Input: 17->15->8->12->10->5->4->1->7->6->NULL
       
       Output: 8->12->10->4->6->17->15->5->1->7->NULL


**Example 2 :**

      // If all numbers are even then do not change the list
      
        Input: 8->12->10->NULL
        
        Output: 8->12->10->NULL
 
 
 >>Time complexity : **O(n)**  & Auxiliary Space : **O(1)**.

***[For Reference](https://practice.geeksforgeeks.org/problems/segregate-even-and-odd-nodes-in-a-linked-list/0)***
