Insert an element at k th position from the start of linked list. Return true if success
Question:
Insert an element at kth position from the start of linked list. Return true if success and if list is not long enough, then return -1.
Take a pointer of head and then advance it by K steps forward, and inserts the node.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Problems Solving In Data Structures And Algorithms Using C++
ISBN: 9789356273177
2nd Edition
Authors: Hemant Jain
Question Posted: