Year End Sale: Get Upto 40% OFF on Live Training! Offer Ending in
D
H
M
S
Get Now

Java: Sort a Linked List of 0s, 1s and 2s

Level : Intermediate
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:35:00

Lab Details

Difficulty Level: EASY

Problem Statement:

Given a linked list of 0s, 1s and 2s. The task is to sort and print it.

Input:

Linked List before sorting

1 2 2 1 2 1 1 0 0

Output:

Linked List after sorting

0 0 1 1 1 1 2 2 2


Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this