#Day85 of #100DaysOfCode Focused on practicing array-based problems with an emphasis on logic and efficiency. Worked on: * Moving zeros to the end of an array * Checking if an array is a palindrome * Calculating the sum of even elements #Java #Arrays #100DaysOfCode
Java Array Practice: Logic and Efficiency
More Relevant Posts
-
Day 69 - Remove Linked List Elements Working with linked lists to efficiently remove all nodes with a specific value using a dummy node approach. Time Complexity: O(n) Space Complexity: O(1) #Day69 #LeetCode #Java #LinkedList #DSA #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
Day 75 – Linked List Cycle Detection Solved a problem to detect whether a linked list contains a cycle using an efficient two-pointer approach. Key Learnings: Applied Floyd’s Cycle Detection Algorithm Understood how different pointer speeds help detect loops Achieved optimal solution with O(1) space and O(n) time complexity #DSA #Java #LinkedList #TwoPointers #ProblemSolving #CodingPractice
To view or add a comment, sign in
-
-
Day 62 — LeetCode Progress (Java) Problem: Merge Strings Alternately Required: Given two strings word1 and word2, merge them by alternating characters, starting from word1. If one string is longer, append the remaining characters at the end. Idea: Use two pointers to traverse both strings simultaneously and build the result step by step. Approach: Initialize two pointers for both strings. Iterate while either string still has characters: Pick one character from word1 (if available) Then pick one from word2 (if available) Continue alternating until both strings are fully traversed. Time Complexity: O(n + m) Space Complexity: O(n + m) #LeetCode #DSA #Java #Strings #TwoPointers #Algorithms #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 64 — LeetCode Progress (Java) Problem: Remove Element Required: Given an array nums and a value val, remove all occurrences of val in-place and return the new length of the array. Idea: Use a two-pointer approach to overwrite unwanted elements while maintaining the order of remaining elements. Approach: Maintain a pointer k to track the position of valid elements. Traverse the array: If the current element is not equal to val, place it at index k Increment k All valid elements are moved to the front of the array. Return k as the new length. Time Complexity: O(n) Space Complexity: O(1) #LeetCode #DSA #Java #TwoPointers #Arrays #Algorithms #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 60 - Remove Duplicates from Sorted List Worked on removing duplicate elements from a sorted linked list. Approach: • Traverse the list once • Compare current node with next node • Skip duplicate nodes by adjusting pointers Time Complexity: O(n) Space Complexity: O(1) #Day60 #LeetCode #Java #LinkedList #CodingPractice #DSA #TechJourney
To view or add a comment, sign in
-
-
Day 75 - Count Complete Tree Nodes Finding the total number of nodes in a complete binary tree using recursion. Approach: • Traverse the tree recursively • Count left subtree • Count right subtree • Add 1 for current node Time Complexity: O(n) Space Complexity: O(h) #Day75 #LeetCode #Java #CodingPractice #TechJourney #DSA #BinaryTree
To view or add a comment, sign in
-
-
Day 65 — LeetCode Progress (Java) Problem: Find All Numbers Disappeared in an Array Required: Given an array of size n containing numbers in the range [1, n], return all the numbers that are missing from the array. Idea: Compare the expected range [1…n] with the actual elements to identify missing values. Approach: Initialize a set containing all numbers from 1 to n. Traverse the array: Remove each element from the set The remaining elements in the set are the missing numbers. Time Complexity: O(n) Space Complexity: O(n) #LeetCode #DSA #Java #HashSet #Arrays #Algorithms #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 21 of #128DaysOfCode 🔍 Key Learnings: Efficient searching in O(log n) Using low & high to narrow the range Finding correct position even if target is absent 🧠 Approach: Compare mid with target → move left/right → return index or insert position Consistency is key 🔥 #DSA #Java #CodingJourney #PlacementPreparation
To view or add a comment, sign in
-
-
#Day95 of #100DaysOfCode Extended the previous number-to-words program to handle multiple digits. The program takes a number as input and prints each digit in its word form. Focused on improving logic by combining loops, string conversion, and conditional handling. #Java #MiniProject #100DaysOfCode
To view or add a comment, sign in
-
-
Day 77 - Binary Tree Postorder Traversal Implemented postorder traversal using recursion. Approach: • Traverse left subtree • Traverse right subtree • Visit node Time Complexity: O(n) Space Complexity: O(h) #Day77 #LeetCode #BinaryTree #DSA #Java #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development