Advertisement
clairec

Untitled

Sep 24th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Enter your code here
  2. template <typename T>
  3. Node<T>* SLL<T>::getNode(std::size_t ind)
  4. {
  5.   if (ind >= size)
  6.     {
  7.       throw "Invalid index!";
  8.     }
  9.   Node<T> * j = front;
  10.   for(std::size_t i = 0; i < size; i++)
  11.     {
  12.       j = j->getNext();
  13.       i++;
  14.     }
  15.   return j;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement