Draw the variable diagram for a C# linkedlist -


i'm facing real problem in understanding how draw variable diagram linked list

in book i'm reading not giving enough info

i post example:


the insert:

public void insert(object newitem, object after) {     node current = new node();      node newnode = new node(newitem);     current = find(after);     newnode.link = current.link;     current.link = newnode; }  private node findprevious(object n) {     node current = header;     while(!(current.link == null) && (current.link.element != n))         current = current.link;     return current; }  public void remove(object n) {     node p = findprevious(n);     if (!(p.link == null))         p.link = p.link.link; } 

i've searched net more info each time found different info can please

are trying draw out on paper homework? if so, link property of each node has reference next node in linked list. draw it, have series of boxes in row represent node classes. in each node, have 2 properties, item , link. link point next node in chain , item point item outside list.

the code provide looks singly linked list. see wikipedia page on linked lists example , simple diagram. in example, numbers data in linked list (your items) , dots arrows links next item in list (the link property.)

hope looking for. otherwise, please revise question.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -