Use a circular linked list with elements being inserted in sorted order.

Inserting minimum element :

struct node *p;
p is a pointer to last node in the circular singly linked list.
newmin->next=p->next;
p->next=newmin;


Deleting minimum element:

struct node *temp;
temp=p->next;
p->next=p->next->next;
free(temp);


Retrieving minimum element :

return (p->next->ele);








*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*



On Sun, Jul 31, 2011 at 2:08 AM, naveen ms <[email protected]> wrote:

> @shubham...i have a doubt.can't the same be done with singly linked list??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to