its a *doubly* linked list ...
you can easily do the job ...

On Sun, Jul 31, 2011 at 2:23 PM, siva viknesh <[email protected]>wrote:

> using LL u cant delete in O(1)  ... u have to traverse from head
>
> On Jul 31, 1:47 pm, Shubham Maheshwari <[email protected]> wrote:
> > use a doubly linked list ... with a field "node *min".
> > weneva you insert an element ... check for the value of min at the head
> ...
> > if the new inserted node has less value ... then set the min field to
> point
> > to itself .... else copy the min field of te previous head.
> >
> > insertion and deletion is easy ... and I hope i dont need to expalin that
> > too ...
> >
> > On Sun, Jul 31, 2011 at 12:27 PM, siva viknesh <[email protected]
> >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Create a data structure where inserting, deleting and finding the
> > > minimum element all have O(1) time.
> >
> > > --
> > > 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.
>
>

-- 
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