Professional Documents
Culture Documents
MySinglyLinkedCircularList Java
MySinglyLinkedCircularList Java
node.getData = data;
node.getNext = last.getNext;
last.getNext = node;
return last;
}
node.getData = data;
node.getNext = last.getNext;
last.getNext = node;
last = node;
return last;
}
Node temp, p;
p = last.getNext;
do
{
if (p.getData == item)
{
temp = new Node();
temp.getData = data;
This study source was downloaded by 100000851302356 from CourseHero.com on 08-30-2022 04:33:33 GMT -05:00
https://www.coursehero.com/file/106719559/MySinglyLinkedCircularListjava/
temp.getNext = p.getNext;
p.getNext = temp;
if (p == last)
last = temp;
return last;
}
p = p.getNext;
} while(p != last.getNext);
}
while(p != last.getNext);
}
public static void main(String[] args)
{
Node add = null;
System.out.println("Singly Linked Circular List");
add = addToEmpty(add, 1);
add = addBegin(add, 2);
add = addBegin(add, 3);
add = addBegin(add, 4);
traverse(add);
}
}
This study source was downloaded by 100000851302356 from CourseHero.com on 08-30-2022 04:33:33 GMT -05:00
https://www.coursehero.com/file/106719559/MySinglyLinkedCircularListjava/
Powered by TCPDF (www.tcpdf.org)