adding cs235
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include "linkedlist.h"
|
||||
#include "node.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
node* head = new node(0, head);
|
||||
node* tom = new node(1, NULL);
|
||||
node* dick = new node(2, NULL);
|
||||
head->next = tom;
|
||||
tom->next = dick;
|
||||
node* node_ptr = head;
|
||||
while(node_ptr != NULL) {
|
||||
cout << node_ptr->value;
|
||||
if(node_ptr != NULL) {
|
||||
cout << "====>";
|
||||
}
|
||||
node_ptr = node_ptr->next;
|
||||
}
|
||||
cout << endl;
|
||||
cout << dick->next << endl;
|
||||
}
|
||||
Reference in New Issue
Block a user