DSA Question 08 || Sum of even digits from a given number || Placement Interview Questions
Автор: MrBlueTiger
Загружено: 2025-09-24
Просмотров: 23
Описание:
📖 Description:
In this video, we write a Java program to calculate the sum of even digits of a number using recursion. The program takes a number, breaks it into digits recursively, checks if the digit is even, and then adds it to the total sum.
You will learn:
✅ How recursion works in digit-based problems
✅ Dry run of the code with example input
✅ Time Complexity: O(log n) (since the number of recursive calls depends on digits)
✅ Space Complexity: O(log n) (stack space due to recursion)
🔎 Example Run:
Input: 123456
Even digits → 2, 4, 6
Sum = 12
✨ If you found this helpful, don’t forget to Like 👍, Share 🔗, and Subscribe 🔔 for more Java tutorials and programming concepts.
#Java #Recursion #Coding #Programming #InterviewPreparation #TimeComplexity #SpaceComplexity
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: