Skip to content

Instantly share code, notes, and snippets.

@lukasjoc
Last active September 13, 2022 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukasjoc/2b6695f096584cd1b6c464f2630c4091 to your computer and use it in GitHub Desktop.
Save lukasjoc/2b6695f096584cd1b6c464f2630c4091 to your computer and use it in GitHub Desktop.
GBICS
# https://arxiv.org/pdf/2110.01111.pdf
In [42]: def sort_simple(l):
...: a = l
...: for i in range(len(a)):
...: for j in range(len(a)):
...: if a[i] < a[j]:
...: tmp = a[i]
...: a[i] = a[j]
...: a[j] = tmp
...: return a
...:
In [43]: ints = [int(random.random() * 1000) for x in range(10)]
In [44]: ints
Out[44]: [499, 306, 429, 276, 879, 858, 321, 316, 778, 295]
In [45]: sort_simple(ints)
Out[45]: [276, 295, 306, 316, 321, 429, 499, 778, 858, 879]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment