Hi I have written such a this code and I want to know that : its time complexity is O(n) ?
DNode header = new DNode(null, null, null);
DNode trailer = new DNode(null, header, null);
header.next = trailer;
for (Point point : pointList) {
DNode node = new DNode(point, header, trailer);
dList.addLast(node);
header = node;
}
I want to copying all objects from the pointList(ArrayList) to a dList(Doubly-Linked list).
thanks