ashawareb / data-structures-implementation-templateClassCpp

data structures implementation using c++ template class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data structures implementation using C++ template class

1- Single and Doubly Linked List

operation :

  • front : return the first element in the list
  • back : return the last element in the list
  • begin : return iterator at the beginning of the list
  • end : return an iterator one element past the last element of the linked list
  • push_front : push element to the beginning of the list
  • push_back : push element to the end of the list
  • insert : insert element to specific position of the list
  • pop_back : remove the last element of the list
  • find : search for a spesific element in the list
  • reverse : reverse the list
  • isEmpty : check if the list is empty or not
  • length : return the size of the list
  • clear : delete all elements in the list
  • print : print the list
  • reversePrint : print the list starting from the last element to the first element (only in the doubly LinkedList)

2- Stack (Array-based & Linked List-based)

operation :

  • push : add element to the stack
  • pop : delete element from the stack
  • top : return the element on the top of the stack
  • isEmpty : check if the stack is empty or not
  • isFull : check if the stack full
  • length : return the number of element in the stack
  • clear : clear all elements in the stack
  • print : print all elements in the stack

some stack application :

  • Check balanced parentheses
  • Evaluation of postfix expression

3- Queue(Array-based & Linked List-based)

operation :

  • push : add element to the queue
  • pop : delete element from the queue
  • isEmpty : check if the queue is empty or not
  • isFull : check if the queue is full or not
  • front : return the first element in the queue
  • back : return the last element in the queue
  • length : return the size of the queue
  • clear : delete all elements in the queue
  • print : print the list

About

data structures implementation using c++ template class


Languages

Language:C++ 100.0%