🍁Day 68 LeetCode: Reverse Linked List (206) Approach: Reversed the linked list iteratively by updating pointers step-by-step while traversing through the list. ✨ Learned how pointer manipulation can transform linked list structures efficiently — a fundamental and must-know problem! 📈 Improved understanding of linked lists, pointer handling, and iterative logic in C++. #LeetCode #100DaysOfCode #DSA #LinkedList #Pointers #ProblemSolving #CodingJourney #CodeEveryday
Reversed Linked List in C++ with Iterative Pointer Manipulation
More Relevant Posts
-
🪷Day 69 LeetCode: Merge Two Sorted Lists (21) Approach: Merged two sorted linked lists by comparing nodes one by one and building a new sorted list using pointer manipulation. ✨ Learned how to handle linked list traversal and merging efficiently — a classic problem to strengthen pointer logic! 📈 Improved understanding of linked list operations, conditional traversal, and iterative merging in C++. #LeetCode #100DaysOfCode #DSA #LinkedList #Pointers #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
🌿Day 71 LeetCode: Remove Nth Node From End of List (19) Approach: Used the two-pointer technique — moved one pointer n steps ahead, then traversed both to locate and remove the target node efficiently. ✨ Learned how the two-pointer approach simplifies linked list problems and improves traversal logic! 📈 Improved understanding of pointer manipulation, edge case handling, and linked list traversal in C++. #LeetCode #100DaysOfCode #DSA #LinkedList #TwoPointers #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
🍂Day 61 LeetCode: Evaluate Reverse Polish Notation (150) Approach: Used a stack to evaluate postfix expressions by pushing operands and applying operators as they appear. ✨ Learned how stack-based evaluation simplifies expression parsing — a great problem to strengthen logic and operator handling! 📈 Improved understanding of stacks, expression evaluation, and efficient parsing techniques in C++. #LeetCode #100DaysOfCode #DSA #Stack #Strings #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
🌟Day 59 LeetCode: Subsets (78) Approach: Used backtracking to generate all possible subsets of a given array by exploring inclusion and exclusion of each element. ✨ Learned how recursion and backtracking can systematically explore all combinations — a classic and insightful problem! 📈 Improved understanding of recursion tree logic, subset generation, and backtracking techniques in C++. #LeetCode #100DaysOfCode #DSA #Backtracking #Recursion #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
💫Day 72 LeetCode: Linked List Cycle (141) Approach: Used an unordered_set to store visited nodes while traversing the list. If a node is already present in the set, a cycle exists. ✨ Learned how hashing helps in detecting cycles efficiently without modifying the linked list — a clean and intuitive solution! 📈 Improved understanding of hash-based detection, pointer traversal, and cycle identification in C++. #LeetCode #100DaysOfCode #DSA #LinkedList #Hashing #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
✨Day 67 LeetCode: Letter Combinations of a Phone Number (17) Approach: Used backtracking to generate all possible letter combinations mapped from digits, following the classic phone keypad pattern. ✨ Learned how recursion and backtracking can explore all possible paths efficiently — a great exercise in mapping and combinatorial logic! 📈 Improved understanding of recursion, string building, and backtracking patterns in C++. #LeetCode #100DaysOfCode #DSA #Backtracking #Strings #ProblemSolving #CodingJourney #CodeEveryday
To view or add a comment, sign in
-
-
C++ tips: user-defined structured bindings It's well known that C++17 introduced structured bindings. However, it is less known that you can use it on a user-defined type even when it's not a simple structure. To do so, you have three steps to follow: 1. Define a templated get function, which will be found either by ADL or as a member method 2. Define the tuple_size structure 3. Define the tuple_element structure You need to do it for const and non-const objects, depending on your needs. EDIT: As pointed out in comments, such a thing is primarily useful when you develop your own tuple-like objects. For classes like Person, prefer using simple getter :). Godbolt link: https://lnkd.in/eHesfzgV
To view or add a comment, sign in
-
-
✨ Day 85 of #100DaysOfCode ✨ Today I worked on the Word Search problem using C++ and Backtracking. In this problem, we’re given a 2D grid of characters and need to check if a given word can be formed by sequentially adjacent letters (up, down, left, or right). 🔹 My approach: Start from every cell that matches the first character of the word. Use recursion to explore all four directions — top, right, bottom, and left. Temporarily mark a cell as visited (using ‘!’) to prevent revisiting it during the same search path. If we reach the end of the word, we return true. After exploring, we backtrack by restoring the cell’s original value. This solution is a great example of depth-first search (DFS) combined with backtracking — a powerful pattern for solving grid-based problems. 💡 Key Concepts Used: Recursion Backtracking 2D Array Traversal Boundary Condition Handling #100DaysOfCode #DSA #CPlusPlus #Backtracking #Recursion #ProblemSolving #CodeNewbie #CodingJourney
To view or add a comment, sign in
-
-
C++Now 2025 - Daniel Pfeifer: "Effective CTest - a Random Selection of C++ Best Practices" youtu.be/whaPQ5BU2y8 Proprietary software is developed and tested by a single entity. Very often, the build and test scripts are located in the project's repository and tend to intertwine with the project configuration. Too many open-source projects follow the same route. For software developed in public, separating "build configuration" from "project configuration" brings advantages. In this talk, I will introduce the CTest scripting mode and show how to write generic build scripts that can be used for any CMake project. I will also present guidelines for project authors to ensure their project configuration does not interfere with generic CTest scripts. The final goal is to establish a development standard for open-source projects, where CI builds are completely decentralized. --- Daniel Pfeifer On a mission to increase developer productivity. Professional Explainer for CMake and C++.
Effective CTest - a Random Selection of C++ Best Practices - Daniel Pfeifer - C++Now 2025
https://www.youtube.com/
To view or add a comment, sign in
-
🔹 19th Problem – Remove Nth Node From End of List Difficulty: Medium 📘 Problem: Given the head of a linked list, the task is to remove the n-th node from the end of the list and return its head. Example: Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] 💡 Algorithm Used – Two Pointer (One-Pass) Approach: To solve this efficiently, I used the two-pointer technique. Create a dummy node before the head to handle edge cases easily. Move the first pointer n + 1 steps ahead to create a gap of n nodes. Move both pointers together until the first reaches the end. The second pointer will now be just before the node that needs to be removed. Adjust the links to remove the target node. ⏱️ Time Complexity: O(L) (We traverse the list only once.) 💾 Space Complexity: O(1) (Constant extra space used.) 🚀 Day 19 of my #120DaysLeetCodeChallenge completed! This problem helped me strengthen my understanding of linked list traversal and efficient pointer manipulation in C++. #LeetCode #DSA #CodingChallenge #TwoPointer #LinkedList #CPlusPlus #ProblemSolving #100DaysOfCode
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