Results 1 to 1 of 1
Thread: is this circle okeh ?
- 04-14-2011, 05:34 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
is this circle okeh ?
Hii every one , how are you
last week i thought to create a circular linked list , because what we took at
college just simply and doubly , and after i looked for more information about
Linked list , i surprised there is "Circular linked list " and "Doubly Circular Linked list".
i tried to create "Circular linked list " , but am not sure if it is true ? can
any body check ,, emmm i was wondering if i can create it using java.util.link....? if that possible ,, how i can do that :rolleyes: ?
Java Code:public class myCLinkedList { // creat head CNode , private CNode head ; public myCLinkedList() { head = null; } public void add(Object obj) { CNode curr = new CNode(obj); if(head==null) { curr.setNext(head); head = curr; } else { curr.setNext(head.getNext()); head.setNext(curr) ; } } public Object delete() { if(head==null) { return "empty list"; } else { Object t = head.getNext().getData(); head.setNext(head.getNext().getNext()); return t; } } public void print() { CNode curr = head; while(curr!=null) { System.out.println(curr.getData()); curr = curr.getNext(); } System.out.println(""); } }
best regards
Similar Threads
-
Calculating points in a circle
By Masochist in forum New To JavaReplies: 5Last Post: 02-14-2011, 06:36 PM -
Trying to write a circle program
By paulmmj in forum New To JavaReplies: 7Last Post: 10-12-2010, 06:06 PM -
Josephu's Circle
By Pyrexkidd in forum New To JavaReplies: 8Last Post: 08-01-2010, 08:44 AM -
Circle arrays
By n00b in forum New To JavaReplies: 15Last Post: 05-05-2010, 05:04 PM -
Circle and line
By c_walker in forum New To JavaReplies: 1Last Post: 01-27-2010, 03:56 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks