for first part - delete all elements starting from 't'th node to end of list

for second part - delete elements starting from 't'th node to end
now only t-1 elements are remaining, delete the first node from that list - since a traversal of t nodes from 1st node on a list of length t-1 would end at 1st node
From there on follow simple traversal and delete nodes.

guys use 2 pointers...
one will traverse the link list...
other will delete the required node and move by required t postion....
the complexity is o(n)...as d slow pointer is the one which will set the loop condition

guys use 2 pointers...
one will traverse the link list...
other will delete the required node and move by required t postion....
the complexity is o(n)...as d slow pointer is the one which will set the loop condition

What's Going On

Books

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Resume Review

Most engineers make critical mistakes on their resumes -- we can
fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.