CLChristian Lundinlundchristian.hashnode.dev·Apr 14, 2023 · 7 min readPOSIX threadsProgram execution To understand threads, it is important to understand how programs execute. Assuming the program is compiled as an executable of some sort, a standard program like the one shown below runs synchronously, i.e. it is printed in order. ...00
CLChristian Lundinlundchristian.hashnode.dev·Apr 10, 2023 · 4 min readSelection SortPhoto credit to Alex Block (alexblock on Unsplash) Algorithm Initialize an index variable to zero, this represents the start of the array. Incrementally traverse the list to find the smallest value in the unsorted array. If the smallest value is ...00
CLChristian Lundinlundchristian.hashnode.dev·Mar 31, 2023 · 3 min readRecursionPhoto credit to Giordano Rossoni on Unsplash Brief description Recursion is a problem-solving technique that can be used when a problem can be solved by solving one or more, smaller versions of the problem itself, often called divide and conquer. In...00
CLChristian Lundinlundchristian.hashnode.dev·Mar 24, 2023 · 3 min readCounting SortPhoto credit to Chrissy Jarvis on Unsplash Algorithm Determine the value range of input values and create a count array of zeros of size equal to the range, as well as an output array of equal size to the input array. Count the number of occurrenc...00
CLChristian Lundinlundchristian.hashnode.dev·Mar 16, 2023 · 3 min readInsertion SortPhoto credit to Theodora Lee (theodoraaaa at Unsplash) Algorithm Start by considering the first element of the array as the sorted subarray. Take the next element and compare it with each element in the sorted subarray from right to left (towards ...00