#include<stdio.h>

#include<conio.h>

#include<alloc.h>

struct link

{

int info;

struct link *next;

};

struct link* create(struct link *ptr,int item)

{

struct link *temp;

temp=(struct link*)malloc(sizeof(struct link)); 242 more words

## Tags » Linked List

#### Q11. Consider a linked list with n integers. Each node of the list is numbered from ‘1’to ‘n’. Write a C program to this list into 4 lists so that first list contains nodes numbered 1,5, 9, 13- - - second list contains nodes numbered 2, 6, 10, 14- - - third list contains nodes numbered 3, 7, 11, 15- - - and fourth list contains nodes numbered 4,8, 12, 16- - -.

#### Remove duplicates from a linked list

**Assumptions:**

- unsorted
- non-circular
- singly linked list

**Input/Output:**

Input: [ 3 ] -> [ 2 ] -> [ 1 ] -> [ 2 ] -> [ 1 ] -> [ 5 ] -> [ 2 ] -> [ 4 ] -> [ 3 ] -> [ 4 ] 68 more words

#### Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

**Solution**

- using a priority queue to keep the organize the k current candidates… 130 more words

#### Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. 187 more words

#### Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.

For example,

Given `1->2->3->3->4->4->5`

, return… 129 more words

#### Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.

If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is. 194 more words