Re: [algogeeks] Direct - i ques

2011-07-31 Thread Shubham Maheshwari
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 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] direct i ..ques

2011-07-28 Thread Aman Goyal
c(n,2) * c(n,2)

On Wed, Jul 27, 2011 at 11:07 PM, siva viknesh wrote:

> No. rectangles in NxN matrix
>
> ... is it   n^2 + (n-2) ??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.