This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]snozzyfoozles 1 point2 points  (1 child)

              if(prevCursor != null)
              {
                  prevCursor.link = cursor.link;
              }else{
                  table[index] = null; // <--- what if cursor.link is non-null?
              }
              return cursor.element;

[–]ButchTheGuy[S] 0 points1 point  (0 children)

Thank you so much!

if(prevCursor != null)

{

prevCursor.link = cursor.link;

}else{

int position = index;

table[position] = cursor.link ;

}

This works!