Category Archives: linkedlist

delete complete linked list with program and Images,better understanding

If we pass head pointer to Delete Method,it should delete the complete linkedlist.Here Main Logic lies as below Steps Step 1: Store Head element into current element Step 2: Point “next Element” of current element to “next Pointer” Step 3: delete current element Step 4: store next pointer to current element Step 5: move next to next element Step… Read More »

How to Rotate Linked List with Easy 4 Steps,explained with images

Rotate the linked list by “k”th element’s in clockwise in a given linked list. let’s go by few examples Example 1: Input:- 10->20->30->40->50->60 and input k = 4 Output:- 50->60->10->20->30->40 Example 2: Input:- 10->20->30->40->50->60 and input k = 3 Output:- 40->50->60->10->20->30 Here is the Main Logic to follow to solve the Problem ( follow from Step 1 to… Read More »