Given a link list, modify the list such that all the even numbers appear before all the odd numbers in the modified list. The order of appearance of numbers within each segregation should be the same as that in the original list.
NOTE: Don't create a new linked list, instead rearrange the provided one.
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(n)
Expected Space Complexity: O(1)
Constraints:
1 <= size of linked list <= 10^5
1 <= Each element of the list <= 10^5
Companies:
AmazonVisaOracleGoldman SachsPaypal
Topics:
Linked List
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.