Our specialists are the backbone of everything we do, and it's always inspiring to see them share their expertise. A great example is our Tech Lead, Oleg Karasik, who has recently published an insightful article on HackerNoon. He implements the Floyd-Warshall algorithm for solving the all-pairs shortest paths problem in C#. This article is the first in a series on HackerNoon, where Oleg dives deep into complex tech concepts. If you're into coding or problem-solving, it's definitely worth checking out: https://lnkd.in/ghtsjYac. #insights #tech #coding #algorithms
Coherent Solutions’ Post
More Relevant Posts
-
#Day78 of #100DaysOfProblemSolving on #LeetCode! Today, I took on Problem #27: "Remove Element" using C++. 🔍 **Problem Overview:** The goal was to remove all occurrences of a specific value from an array in place, minimizing the use of extra memory. 💡 **Approach:** I implemented a two-pointer technique, which allowed me to efficiently move through the array and shift elements, ensuring that the target value was removed while maintaining the order of the remaining elements. 📈 **Algorithm Design:** This approach keeps the space complexity at O(1), making it highly efficient for larger inputs. The time complexity is O(n), making it a simple yet effective solution. 🔗 [Problem Link]: https://lnkd.in/gtZ-2cAy 🔗 [Solution Link]: https://lnkd.in/gr-uePuJ #LeetCode #CPlusPlus #ProblemSolving #DataStructures #Algorithms #100DaysOfCode #TechCommunity #GeetaUniversity #GTH
To view or add a comment, sign in
-
#day64 Problem Statement:- Given head, the head of a linked list, determine if the linked list has a cycle in it. A cycle exists if there is a node in the list that can be revisited by continuously following the next pointer. The function should return true if there is a cycle, otherwise false. Approach:- To detect a cycle in a linked list, we can use Floyd’s Cycle-Finding Algorithm, also known as the Tortoise and Hare Algorithm: Initialize two pointers, fast and slow, both starting at the head of the list. Move slow by one step and fast by two steps in each iteration. If there is a cycle, fast and slow will eventually meet. If fast reaches the end (null), then there is no cycle. Approach-2:- we can also use map for storing the addresses of nodes,traverse along the linked list,if the address is not present in the map,insert it,if the map contains the address of node ,then return that address ,as it is the first that repeated twice,so it is the point where the loop starts,hence loop is detected.But this approach takes O(n) space complexity,where n is the number of noed present in the linked list. Time Complexity:- The algorithm runs in O(n) time, where n is the number of nodes in the linked list. Each node is visited at most once. Space Complexity:- The space complexity is O(1) as it uses only two pointers, regardless of the size of the linked list. #Coding #Programming #LeetCode #LinkedLists #Algorithms #Tech #ProblemSolving #DataStructures #Cpp #InterviewPrep #TechCommunity
To view or add a comment, sign in
-
I wrote a guide on creating an OpenWRT daemon from a C program. In this guide, I explain how to link a package to an existing library in the base image—a common issue discussed in the forums. I noticed that the available answers are often not descriptive #OpenWRT #Embedded #Technology
Building an OpenWRT Daemon with Custom C Program and UCI config file
http://nextiaixtli.wordpress.com
To view or add a comment, sign in
-
I'm thrilled to share my latest coding milestone. I've just cracked another challenging problem on LeetCode: Problem #226 - Invert Binary Tree. Each step forward in this journey keeps pushing my problem-solving skills to the next level. The approach used in this problem is recursion. The function recursively inverts the left and right subtrees, then swaps them. This process continues until all nodes are visited, inverting the entire tree. Time Compelxity: O(n) Space Complexity: O(h) #InvertBinaryTree #Recursion #LeetCode #ProblemSolving #Algorithms
To view or add a comment, sign in
-
Day 50 of #100DaysOfCode Platform: LeetCode Problem: Binary Tree Inorder Traversal Problem Statement: Given the root of a binary tree, return the inorder traversal of its nodes' values. Solution Idea: I used a recursive approach to solve this problem. The idea is to define a helper function that takes a node and a result vector as parameters. The function first checks if the node is nullptr, and if so, it returns immediately. Otherwise, it recursively calls itself on the left child of the node, pushes the value of the node onto the result vector, and then recursively calls itself on the right child of the node. This approach ensures a time complexity of O(n) and a space complexity of O(h), where n is the number of nodes and h is the height of the tree. #DrGViswanathan #LeetCode #BinaryTrees #Recursion #CodingChallenges
To view or add a comment, sign in
-
Problem: 'Sqrt(x)' 💻🔢 #day25 I used a binary search approach to find the square root of a non-negative integer x, rounding down to the nearest integer. No built-in exponent functions allowed! The key steps: 1. Initialize left and right pointers to 1 and x 2. Iterate until left <= right 3. Calculate the midpoint 4. Check if mid^2 == x, return mid 5. If mid^2 < x, update left = mid + 1 6. Else, update right = mid - 1 This solution has a time complexity of O(log x) and space of O(1). Felt good to implement this logic from scratch! 🧠💡 What other coding challenges have you been working on lately? Share in the comments below! 👇 #CodeChallenge #AlgorithmDesign #CodingProblems
To view or add a comment, sign in
-
#Day98 of #100DaysOfProblemSolving on #LeetCode! 💻 Today, I solved Problem #2696: "Minimum String Length After Removing Substrings" using C++. 🔍 Problem Overview: The challenge was to reduce the length of a string by repeatedly removing specific substrings ("AB" and "CD") until no more removals could be made. 💡 Approach: I used a stack-based approach to simulate the removal process efficiently. By iterating through the string and leveraging a stack, I was able to track and eliminate valid substrings in an optimized manner. 📈 Algorithm Design: This approach ensures an O(n) time complexity, making it highly efficient for large strings while maintaining a clear structure to handle multiple removals. 🔗 [Problem Link]: https://lnkd.in/gEGrd-d7 🔗 [Solution Link]: https://lnkd.in/gEYPbppi #LeetCode #CPlusPlus #CodingChallenge #ProblemSolving #100DaysOfCode #TechCommunity #DataStructures #Algorithms #GeetaUniversity #GTH
To view or add a comment, sign in
-
Day 93 of #100DaysofCoding 😊 LeetCode POTD: (Done ✅) 1) Combination Sum II Approach1: Using Backtracking: First, sort the array to handle duplicates easily. Then use a recursive function to explore all possible combinations. Include the current element if it doesn’t exceed the target, and then backtrack by removing it. To avoid duplicate combinations, skip over consecutive duplicate elements after considering one. Finally, if the target reaches zero, add the current combination to the result list. This approach ensures that you find all unique combinations that sum up to the target. solution: [https://lnkd.in/gP5H3VcP] Approach2: Using DP First, sort the array to handle duplicates easily. Then use a recursive approach to explore all valid combinations by including or excluding each element. Store the results in a memoization table to avoid recalculating combinations for the same target. Finally, return the stored results to quickly access all unique combinations that sum up to the target. solution: [https://lnkd.in/gw6HBKZs] GeeksforGeeks POTD: (Done ✅) 2) Square root of a number Approach1: The first way using inbuild function sqrt(). Approach2: The Second one is that, by using the binary search. Intuition: Apply binary search within the range [0,n] to determine the perfect square root. For each midpoint mid, check if mid×mid equals n. If it does, then mid is the perfect square root, and you can return it. If mid×mid is greater than n, reduce the search range by setting e=mid−1. If mid×mid is less than n, update the answer to mid and reduce the search range by setting s=mid+1. Continue this process until the search range is exhausted, and return the last stored value as the floor of the square root. solution: [https://lnkd.in/gn272NK4] 💻#100DaysOfCode #LEETCODE #POTD #LeetCode #Coding🚀
To view or add a comment, sign in
-
I'm excited to share my latest coding accomplishment! I've successfully solved LeetCode Problem #24– Swap Nodes in Pairs. The approach used in this problem is iterative traversal using two-pointer technique. This approach uses an iterative approach to swap adjacent nodes' values in pairs in a linked list. It traverses the list in a loop, swapping values between slow and fast pointers and then moving them forward by two nodes at a time until the end of the list is reached. Time Complexity: O(N) Space Complexity: O(1) #IterativeTraversal #TwoPointerTechnique #SwapNodes #LeetCode #ProblemSolving #Algorithms
To view or add a comment, sign in
-
Day 14: Today I have solved 154. Find Minimum in Rotated Sorted Array II which is similiar to the problem I have already solved on Day 12. The problem context is to return the minimum value in rotated sorted array which contains duplicates. As array is sorted the first intuition that got in my mind is to solve the problem using binary search. Started with two pointers one at beginning(left pointer) and other at end(right pointer), I divided array into two halves but calculating mid pointer value, If right half of array is sorted then moved right pointer to point at mid otherwise moved left pointer to point at mid+1 and continued searching for minimum in either of halves. To handle the edge case if all the three pointers(left, mid, right) point to the same value that is repeated, I tried to shrink the array but incrementing and decrementing left and right pointers respectively. Using this approach would solve the problem in Order of logN time complexity. #50dayschallenge #problemsolving #coding #software #tech #leetcode
To view or add a comment, sign in
13,158 followers