Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain how to find 3rd element from end in a linked list in one pass?



Explain how to find 3rd element from end in a linked list in one pass?..

Answer / Mithilesh Prasad

One approach is to maintain two pointers slow and fast initially at the head of the list. Move fast two steps ahead for each step that slow moves forward. Once fast reaches the end, slow will point to the second to last node. Move slow one more step forward to get the third-to-last node.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is the limit of arraylist?

1 Answers  


Does arraylist guarantee insertion order?

1 Answers  


What do you know about the big-o notation and can you give some examples with respect to different data structures?

1 Answers  


What is data structure? Explain.

1 Answers  


Write an algorithm to show the reverse of link list?

1 Answers  


Is hashmap fail safe?

1 Answers  


In the given binary tree, using array you can store the node 4 at which location? 1 2 3 - - 4 - - 5

1 Answers  


How can we delete the first node from the singly linked list?

1 Answers  


Is copyonwritearraylist thread safe?

1 Answers  


What is huffman’s algorithm?

1 Answers  


What is a stable sorting algorithm?

1 Answers  


What is stack algorithm?

1 Answers  


Categories