×

# Arrange linked list around given value x

Write an efficient algorithm to Arrange linked list around given value x.
note that x is an integer value. arrange the node which are satisfied following condition.

1) All less than value of x is left side.

2) And arrange all node to x in right side which are gratore than or equal to x.

**Example**

**Function**

Given linked list contain following nodes [1 7 6 2 9 5 11 ].

View Nodes and pointer.

Given X=6. After arrange.

change the node link.

Program for Arrange a linked list around a given value x.

**Output**

Visualize process.

#### Recommended Posts:

- Print middle N nodes of linked list
- Move a given occurrences at end of linked list
- Split a linked list into two halves
- Find minimum value in linked list
- Remove half nodes from end of linked list
- Merge two sorted linked lists
- Reverse second half of linked list
- Sort a linked list of 0s 1s and 2s
- Splay tree search element

View comments and participate Discussion