Manraj-Mann / Hacktoberfest-DSA-Codes

Add the DSA codes in any language in defined folder to maintain a repository to help students learn DSA
9 stars 52 forks source link

code for swap nodes in pair #80

Open gaurav-312 opened 1 year ago

gaurav-312 commented 1 year ago

Example 1:

Input: head = [1,2,3,4] Output: [2,1,4,3]

Example 2:

Input: head = [] Output: []

Example 3:

Input: head = [1] Output: [1]