What will be the size of the array? You don't know the number of nodes in
the graph. Implementing table doubling would be tedious.

If they asked for a specific language implementation then for c++ you can
use a vector of linked lists.
Otherwise a linked list of pointers to head of linked lists would be a good
option, I think.

Sukun Tarachandani
IDD Electrical Engineering(2nd year)
IIT Roorkee


On Thu, Apr 26, 2012 at 1:06 PM, bharat b <[email protected]>wrote:

> In input, he mentions #nodes and #edges of each nodes has, right?
> create an array of linked lists.. each index in the array represents the
> node number and the linked list of that represents edges of that node.
> Am I right?
>
>
> On Wed, Apr 25, 2012 at 5:40 PM, Radhakrishnan Venkataramani <
> [email protected]> wrote:
>
>> How will you implement a graph data structure ?
>> Give an linked implementation  as we do not know how many nodes will be
>> there and how many edges will be there.
>> Make a copy of this graph..
>>
>>
>>  --
>> 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