data-structures-and-algorithms

Linked List Kth from End

Write a method for the Linked List class which takes a number, k, as a parameter. Return the node’s value that is k from the end of the linked list.

Challenge

Extend the linked list with these three different methods:

.kthFromEnd(k) (returns the node’s value that is k from the end of the linked list)
Input: a number k used as a search value Output: the value of the node k places from the end of the linked list
Edge case(s):

Approach & Efficiency

Big O Notation

Testing

Write tests to prove the following functionality:

Whiteboard Solution

code-challenge-07

Hello Teacher Mohamed I’m Emad This is Screen Shot of Test

Test