11. Leetcode - Remove nth node from end

Pubblicato il: 11 giugno 2022
sul canale di: Amit Bhave
12
1

Problem: https://leetcode.com/problems/remove-...

Algorithm: 2 pointers. Start fast pointer n nodes ahead of slow pointer, so that when fast pointer reaches at the end, slow pointer reaches at (n-1)st node, and then we can remove nth node from the end of the Linked List in a single traversal.

Code: https://github.com/Amitbhave/leetcode...

Time Complexity: O(n)


In questa pagina del sito puoi guardare il video online 11. Leetcode - Remove nth node from end della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Amit Bhave 11 giugno 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 12 volte e gli è piaciuto 1 spettatori. Buona visione!