Intro to linked lists

16 Mar

Got working on linked lists this week for the first time since my Java class in high school. Much easier to follow in C++ versus Java, having pointers and literal arrows ‘->’ makes the concept much easier to grasp, although challenging nonetheless. As Fardad has stated several times, when mapping these things out, having a multi colored pen is beneficial. I did’nt have one, but I had 2 markers, a black pen, a pencil, and an imagination. here is the diagram I used when programming my doubly linked list:




I intend to optimize it over the weekend and I will post my code, here is my queue single linked list add function : (big up to Nick Kemp for help with this one)



void Queue::add(int data){


_head=new Node(data);
while (t->_next){
t->_next=new Node(data);