April 2018
Intermediate to advanced
322 pages
6h 57m
English
Now, it's time to consume our new LinkedList data type in our code. We can use all of the operations of the data type. We will try to initialize a new LinkedList, add several items, and then invoke the Get(), Insert(), Search(), and Remove() operations. Don't worry about invoking these operations in a specific order; as long as we have instantiated the LinkedList object, everything will work since we have restricted the out of bound index problem. Without further ado, here's the code:
// Project: Singly_Linked_List.cbp// File : main.cpp#include <iostream>#include "Node.h"#include "LinkedList.h"using namespace std;int main(){ // NULL LinkedList<int> linkedList = LinkedList<int>(); // 43->NULL linkedList.InsertHead(43); ...