Tag: Algorithms

  • Three-Step Reversal Algorithm

    Three-Step Reversal Algorithm

    This technique is a popular and efficient approach for rotating an array to the right without using any extra space. Involves three main steps: Reverse the entire array, Reverse the first k elements of the array, and Reverse the remaining n-k elements of the array.

  • Bubble sort

    Bubble sort

    The Bubble sort is the simplest algorithm to sort arrays. The goal is to sort a list of elements in the order that we need, comparing a pair of adjacent elements and perform a swap of these elements if they are in the wrong order (the most of the time is the ascending order).

  • Swap with Auxiliary Variable

    Swap with Auxiliary Variable

    The technique is a common approach used in programming to swap the positions of two values. It involves the use of a temporary variable as an intermediate storage space