Pergunta de entrevista da empresa Commvault

Round 1:Reverse linked list in alternate groups of k.

Resposta da entrevista

Sigiloso

27 de ago. de 2020

I created a function of reversing the linked list. I then traversed the linked list and created a loop till k and reversed the list and also kept a bool value for checking whether it was the first k nodes and for that saved the head and then for next k nodes made no changes and so on till NULL and returned head.