Day 20 of Programming – Rearranging Programs Today I practiced array rearrangement problems, which are very useful for improving logic building and problem-solving skills. Rearranging elements in an array helps in understanding index manipulation, swapping techniques, and efficient iteration. 🔹 What I learned today: ✅ Rearranging elements based on conditions ✅ Using loops and swapping techniques ✅ Improving array manipulation skills ✅ Writing optimized solutions 🔹 Practice Problems I Worked On: • Rearrange array in ascending and descending order • Rearrange array so positive and negative numbers alternate • Move all zeros to the end of the array • Rearrange elements so that even numbers come before odd numbers • Reverse an array using swapping technique #Programming #Java #Arrays #ProblemSolving #CodingJourney #Developer #LearningToCode
Rearranging Arrays for Improved Logic and Problem-Solving Skills
More Relevant Posts
-
💡 Understanding the Object Creation Process Using Tracing While learning Object-Oriented Programming, I realized that creating an object is more than just writing a line of code. Tracing the process step-by-step helps us understand what actually happens inside the system. Here’s a simple way to visualize the object creation process: 🔹 Class Loading – The program first loads the class definition into memory. 🔹 Memory Allocation – When an object is created, memory is allocated for it (usually in the heap). 🔹 Initialization – The constructor initializes the object's attributes with the given values. 🔹 Reference Assignment – A reference variable stores the address of the object so it can be accessed later. 📌 Why tracing is important? Tracing helps us understand program flow, debug errors more easily, and build a stronger foundation in programming concepts. Every small concept we understand deeply makes us a better developer step by step. 🚀 #Programming #Java #ObjectOrientedProgramming #LearningJourney #Coding
To view or add a comment, sign in
-
-
Object-Oriented Programming (OOP) is the biggest hurdle for anyone learning to code. In this video, we'll transform lines of code into tangible objects so you can finally understand, in a completely visual way, how the software factory works.
Object-Oriented Programming (OOP) Simply Explained
https://www.youtube.com/
To view or add a comment, sign in
-
𝐃𝐚𝐲 𝟑𝟗 – 𝐃𝐒𝐀 𝐉𝐨𝐮𝐫𝐧𝐞𝐲 | 𝐀𝐫𝐫𝐚𝐲𝐬 🚀 Today’s problem focused on finding the minimum path sum in a triangle using Dynamic Programming. 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐒𝐨𝐥𝐯𝐞𝐝 • Triangle 𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡 • Started from the last row of the triangle • Stored values in a DP array • Moved row by row upward • For each element, added the minimum of its two possible children Formula used: dp[col] = value + min(dp[col], dp[col + 1]) This bottom-up approach avoids recalculating subproblems. 𝐊𝐞𝐲 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠𝐬 • Bottom-up DP simplifies many path problems • Only the next row is needed to compute the current row • Space optimization is possible by using a single array • Breaking a problem into smaller overlapping subproblems is the essence of DP 𝐂𝐨𝐦𝐩𝐥𝐞𝐱𝐢𝐭𝐲 • Time: O(n²) • Space: O(n) 𝐓𝐚𝐤𝐞𝐚𝐰𝐚𝐲 Dynamic Programming often becomes easier when you start from the bottom and build your way up. 39 days consistent 🚀 On to Day 40. #DSA #Arrays #DynamicProgramming #LeetCode #Java #ProblemSolving #DailyCoding #LearningInPublic #SoftwareDeveloper
To view or add a comment, sign in
-
-
Built a custom string handling class in C++ from scratch — without using std::string. This project focuses on: • Dynamic memory management using new[] and delete[] • Implementation of the Rule of Three (Destructor, Copy Constructor, Copy Assignment) • Manual string manipulation algorithms (reverse, case conversion, word counting) • Operator overloading for intuitive usage (+, +=, [], (), comparison operators) The goal was to deeply understand how strings work internally rather than relying on built-in abstractions. A great exercise in mastering memory management, object-oriented programming, and low-level string operations in C++. #cpp #programming #softwareengineering #oop #learning #developers
To view or add a comment, sign in
-
🔷 4 OOP Pillars in C# — Every Developer Must Master These Object-Oriented Programming is not just theory. It's how you build systems that scale and last. Here are the 4 pillars, explained simply 📦 1 — Encapsulation Hide internal data. Expose only what's needed. Use private fields with public properties. Your object controls its own state — nothing else should touch it directly. 🧬 2 — Inheritance Child class inherits from parent. Reuse, extend, and override. class Dog : Animal { } — Dog gets everything Animal has, plus its own behavior. 🎭 3 — Polymorphism Same method name, different behavior depending on the object. virtual + override — one interface, many implementations. 🧩 4 — Abstraction Hide complexity. Show only the interface. Use abstract class or interface — code to contracts, not to concrete details. 💡 These 4 pillars are the foundation of every clean C# codebase I've worked on. Which one do you find most powerful in real projects? #CSharp #OOP #DotNet #BackendDevelopment #SoftwareEngineering #CleanCode #Programming
To view or add a comment, sign in
-
-
🔥 Day 36 of #LeetCode Journey ✅ Problem: Minimum Distance Between Three Equal Elements I Today’s problem was about finding the minimum distance between three equal elements in an array. 💡 Key Idea: Instead of checking all combinations, we track indices efficiently: Store the last two occurrences of each number When a third occurrence appears, calculate the distance Keep updating the minimum distance 🧠 What I Learned: Optimizing from brute force to O(n) approach Using HashMap effectively for tracking indices Thinking in terms of patterns instead of combinations ⚡ Time Complexity: O(n) ⚡ Space Complexity: O(n) 🔍 Example: Input: [1,2,1,1,3,1] Output: 3 Small optimizations make a big difference 💡 Staying consistent and improving every day! #Java #DSA #LeetCode #CodingJourney #100DaysOfCode #Programming #ProblemSolving
To view or add a comment, sign in
-
-
cuTile Rust: a safe, tile-based kernel programming DSL for the Rust programming language https://lnkd.in/gC7vRfi4 features a safe host-side API for passing tensors to asynchronously executed kernel functions
To view or add a comment, sign in
-
-
The Perl qw() operator is a useful feature for transforming strings into arrays, enhancing code readability and efficiency. This article explores its syntax, functionality, and real-world examples for better data handling in scripts. 🔗 Read more: https://lnkd.in/dM4NNdM3 #Perl #SoftwareDevelopment #Programming #CodingBestPractices #Developers #TechLearning
To view or add a comment, sign in
-
-
Post No: 044 Today I learned something interesting about C++ casting. Earlier, in old C-style syntax, type conversion was usually written like this: int x = (int) 3.14; This works, but it does not clearly show what type of conversion is happening. The same style can be used for multiple kinds of casts, which can sometimes make the code difficult to read and even unsafe. Modern C++ introduced a clearer way: int x = static_cast<int>(3.14); This is called explicit casting. What I found interesting is that it makes the developer’s intention very clear. Anyone reading the code can immediately understand that the conversion is being done deliberately. C++ also provides different cast types for different use cases: - static_cast -> normal type conversion - dynamic_cast -> inheritance and OOP - const_cast -> remove const - reinterpret_cast -> low-level memory conversion #cpp #cplusplus #softwaredevelopment #programming #coding #developers #learning #tech
To view or add a comment, sign in
-
-
Day 1 of 30 — C# tip that cleaned up my codebase overnight 🧹 I used to write 5-line null checks. Then I found ?? and ??=. Saved me hours of boilerplate and made code reviews much smoother. Full breakdown is in the image below👇 Which of these do you already use — and what null-handling trick do you swear by? Drop it below 👇 #CSharp #DotNet #CleanCode #SoftwareEngineering #Programming
To view or add a comment, sign in
-
Explore related topics
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