ayushi-ras / beginner-contribution-

Beginners Friendly
MIT License
13 stars 63 forks source link

DSA Problem: Reverse a Linked List #16

Closed Haris-Mohanty closed 1 year ago

Haris-Mohanty commented 1 year ago

Problem Description:

Given the head of a singly linked list, reverse the list and return its head.
Write a function or algorithm to solve this problem efficiently.

Input:

The head node of a singly linked list.

Output:

Return the head node of the reversed linked list.

Example:

## Input:
        1 -> 2 -> 3 -> 4 -> 5 -> null
## Output:
      5 -> 4 -> 3 -> 2 -> 1 -> null
Haris-Mohanty commented 1 year ago

@ayushi-ras, Please assign me this issue.