• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
November 04, 2024 |140 Views

PROBLEM OF THE DAY : 03/11/2024 | Is Linked List Length Even?

Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Shivam Sharma We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Linked List but also build up problem-solving skills.

Given a linked list, your task is to complete the function isLengthEven() which contains the head of the linked list, and check whether the length of the linked list is even or not. Return true if it is even, otherwise false.

Examples:

Input: Linked list: 12->52->10->47->95->0

Output: true
Explanation: The length of the linked list is 6 which is even, hence returned true.
 

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/linked-list-length-even-or-odd/1