Author: Felix Tang

  • Bash Scripts Basic

    The term “shell” encompasses any software program that offers a command-line interface to interact with an operating system. Among various types of shells, “Bash” is a popular one extensively utilized in Unix/Linux systems. A bash script is a file that ends with the “.sh” extension and contains a series of commands and logic controls. When Read more

  • Recursion : how to change from non-tail to tail

    (1) Introduce an accumulator parameter in the recursive function. Initialize the accumulator with a value that satisfies two conditions a) when the smallest value is passed from main() to the recursive function, it can correctly return the result to the main program. b) it gives the correct intermediate accumulator at the first recursive call (2) Read more

  • Recursion: Enhance performance through Memoization and Tabulation

    Memoization or memoisation is an optimization technique used in computing to accelerate program execution. It involves storing the results of costly function calls, particularly to pure functions, and retrieving the cached result when the same inputs are encountered again. By saving the outcomes of previous operations in a data structure like an array or hash Read more