TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Linked list implementation using Arrays. More...
#include <iostream>
Go to the source code of this file.
Classes | |
class | Node< ValueType > |
Functions | |
void | initialise_list () |
int | getnode () |
void | freeNode (int nodeToBeDeleted) |
void | insertAtTheBeginning (int data) |
void | insertAtTheEnd (int data) |
void | display () |
int | main () |
Variables | |
Node | AvailArray [100] |
array that will act as nodes of a linked list. | |
int | head = -1 |
int | avail = 0 |
Linked list implementation using Arrays.
The difference between the pointer implementation of linked list and array implementation of linked list:
Definition in file linkedlist_implentation_usingarray.cpp.
void display | ( | ) |
Definition at line 69 of file linkedlist_implentation_usingarray.cpp.
void freeNode | ( | int | nodeToBeDeleted | ) |
This function when called will delete the node with the index presented as an argument, and will put back that node into the array.
Definition at line 42 of file linkedlist_implentation_usingarray.cpp.
int getnode | ( | ) |
This will return the index of the first free node present in the avail list
Definition at line 32 of file linkedlist_implentation_usingarray.cpp.
void initialise_list | ( | ) |
Definition at line 23 of file linkedlist_implentation_usingarray.cpp.
void insertAtTheBeginning | ( | int | data | ) |
The function will insert the given data into the front of the linked list.
Definition at line 50 of file linkedlist_implentation_usingarray.cpp.
void insertAtTheEnd | ( | int | data | ) |
Definition at line 57 of file linkedlist_implentation_usingarray.cpp.
int main | ( | void | ) |
Main function
Definition at line 79 of file linkedlist_implentation_usingarray.cpp.
int avail = 0 |
Definition at line 22 of file linkedlist_implentation_usingarray.cpp.
Node AvailArray[100] |
array that will act as nodes of a linked list.
Definition at line 19 of file linkedlist_implentation_usingarray.cpp.
int head = -1 |
Definition at line 21 of file linkedlist_implentation_usingarray.cpp.