4259 links
  • Arnaud's links
  • Home
  • RSS Feed
  • Tag cloud
  • Login
search: tag:algo — newest first
  • Bubble sort algo

    def bubbleSort(arr):
    n = len(arr)

    # Traverse through all array elements
    for i in range(n):
    
        # Last i elements are already in place
        for j in range(0, n-i-1):
    
            # traverse the array from 0 to n-i-1
            # Swap if the element found is greater
            # than the next element
            if arr[j] > arr[j+1] :
                arr[j], arr[j+1] = arr[j+1], arr[j
    
    February 6, 2022 - permalink - https://www.geeksforgeeks.org/bubble-sort/
    algo
  • BInary search algo

    def binary_search(l, item):
    first = 0
    last = len(l)-1
    found = False

    while first<=last and not found:
        midpoint = round((first + last)/2)
        if l[midpoint] == item:
            found = True
        else:
            if item < l[midpoint]:
                last = midpoint-1
            else:
                first = midpoint+1
    
    return found
    

    input = [0, 1, 2, 8, 13, 17, 19, 32, 42,]

    print(binary_search(input, 3)) # found: False
    print(binary_search(input, 13)) # fount: True

    February 6, 2022 - permalink - https://links.infomee.fr/shaare/GnzD5Q
    algo nomarkdown search
  • Quick sort algo

    from random import randrange

    input = [10, 5, 2, 3, 7, 0, 9, 12]

    def quicksort(arr):
    if len(arr) < 2:
    return arr
    else:
    rand = randrange(0, len(arr)) # grab a random index
    pivot = arr.pop(rand)
    less = [i for i in arr if i <= pivot]
    greater = [i for i in arr if i > pivot]
    return quicksort(less) + [pivot] + quicksort(greater)

    print("sorted: ", quicksort(input))

    February 6, 2022 - permalink - https://www.integralist.co.uk/posts/algorithmic-complexity-in-python/
    algo nomarkdown recursiv sort
  • HackerRank
    September 25, 2021 - permalink - https://www.hackerrank.com/
    algo code datadog dev entretien exercice training
  • Advent of Code
    December 8, 2019 - permalink - https://adventofcode.com
    advent algo code
  • GitHub - tayllan/awesome-algorithms: A curated list of awesome places to learn and/or practice algorithms.
    June 28, 2018 - permalink - https://github.com/tayllan/awesome-algorithms
    algo code
  • GitHub - TheAlgorithms/Python: All Algorithms implemented in Python
    June 28, 2018 - permalink - https://github.com/TheAlgorithms/Python
    algo code python
  • Python-programming-exercises/100+ Python challenging programming exercises.txt at master · zhiwehu/Python-programming-exercises · GitHub
    May 28, 2018 - permalink - https://github.com/zhiwehu/Python-programming-exercises/blob/master/100%2B%20Python%20challenging%20programming%20exercises.txt
    algo code dev python
  • A Rubyist's Guide to Big-O Notation

    Big-O illustré en ruby

    November 17, 2016 - permalink - http://blog.honeybadger.io/a-rubyist-s-guide-to-big-o-notation/
    algo bigo dev ruby
  • Top 10 Algorithms for Coding Interview

    to level up

    • https://www.cs.cmu.edu/~cburch/survey/recurse/hanoiimpl.html
    • https://rosettacode.org/wiki/Rosetta_Code
    April 13, 2016 - permalink - http://www.programcreek.com/2012/11/top-10-algorithms-for-coding-interview/
    algo code coding dev interview
  • Generating weighed random numbers in JavaScript

    Algo pour faire du random avec poids

    January 12, 2015 - permalink - http://www.javascriptkit.com/javatutors/weighrandom2.shtml
    algo random weight
  • VisuAlgo - visualising data structures and algorithms through animation

    super cool pour comprendre les algos!

    August 19, 2014 - permalink - http://www.comp.nus.edu.sg/~stevenha/visualization/index.html
    algo dev