Skip to content

Instantly share code, notes, and snippets.

View gsscoder's full-sized avatar
💭
obsessive coding disorder

coder (π³) gsscoder

💭
obsessive coding disorder
View GitHub Profile
@aidapsibr
aidapsibr / nuget-cache-projects.yml
Created January 20, 2020 10:47
Example using actions/cache to create a cache for all nuget packages based on project files (assumes PackageReference is used)
- uses: actions/cache@v1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files
restore-keys: |
${{ runner.os }}-nuget-
@Tofunmi1
Tofunmi1 / README.md
Created July 31, 2022 20:22
Bubble sort algorithm in yul

Recursive Implementation Of Bubble Sort in solidity and yul

***credit -> geekforgeeks -> https://www.geeksforgeeks.org/bubble-sort/

The idea is to place the largest element at their position and keep doing the same for every other elements.

Approach:

Place the largest element at their position, this operation makes sure that first largest element will be placed at the end of array. Recursively call for rest n – 1 elements with same operation and placing the next greater element at their position. Base condition for this recursion call would be, when number of elements in the array becomes 0 or 1 then, simply return (as they are already sorted).