Skip to content

Instantly share code, notes, and snippets.

View focks's full-sized avatar
🎯
Focusing

Chandan Kumar Singha focks

🎯
Focusing
View GitHub Profile
@focks
focks / reverse_linked_list.cc
Created March 27, 2016 14:00
reverse a linked list. ( in place reversing in one pass )
/*
* struct ListNode{
* int val;
* ListNode *next;
* ListNode(int x) : val(x),next(NULL) {}
* };
*/
ListNode * reverse_list(ListNode *head){
// only one element or no element