Skip to content

ZEROONES

  • Home
  • Verilog
  • Python
  • Arduino
  • C
  • Contact

ZEROONES

  • Home
  • Verilog
  • Python
  • Arduino
  • C
  • Contact

zeroones.org

Python Program to Implement Radix Sorting

13 December 2022 by zeroones.org

01. Example: def radixSorting(data, base=10): if data == []: return def keyFactory(digit, base): def key(data, index): return ((data[index]//(base**digit)) % base) return key largest = max(data) exp = 0 while base**exp …

Read more

Python Program to Implement Comb Sorting

12 December 2022 by zeroones.org

01. Example: def combSorting(data): def swap(i, j): data[i], data[j] = data[j], data[i] gap = len(data) shrink = 1.3 flag = False while not flag: gap = int(gap/shrink) if gap < …

Read more

Python Program to Implement Bubble Sorting

11 December 2022 by zeroones.org

01. Example: def bubbleSorting(data): for i in range(len(data) – 1, 0, -1): flag = True for j in range(0, i): if data[j + 1] < data[j]: data[j], data[j + 1] …

Read more

Python Program to Implement Shell Sorting

10 December 2022 by zeroones.org

01. Example: def gaps(size): length = size.bit_length() for k in range(length – 1, 0, -1): yield 2**k – 1 def shellSorting(data): def insertionSortingWithGap(gap): for i in range(gap, len(data)): temp = …

Read more

Python Program to Implement Counting Sorting

9 December 2022 by zeroones.org

01. Example: def countingSorting(data, largest): c = [0]*(largest + 1) for i in range(len(data)): c[data[i]] = c[data[i]] + 1 c[0] = c[0] – 1 for i in range(1, largest + …

Read more

Python Program to Implement Gnome Sorting

8 December 2022 by zeroones.org

01. Example: def gnomeSorting(data): for i in range(1, len(data)): while (i != 0 and data[i] < data[i – 1]): data[i], data[i – 1] = data[i – 1], data[i] i = …

Read more

Python Program to Implement Selection Sorting

7 December 2022 by zeroones.org

01. Example: def selectionSorting(data): for i in range(0, len(data) – 1): smallest = i for j in range(i + 1, len(data)): if data[j] < data[smallest]: smallest = j data[i], data[smallest] …

Read more

Python Program to Implement Bucket Sorting

6 December 2022 by zeroones.org

01. Example: def bucketSorting(data): largest = max(data) length = len(data) size = largest / length buckets = [[] for _ in range(length)] for i in range(length): j = int(data[i] / …

Read more

Python Program to Implement Insertion Sorting

5 December 2022 by zeroones.org

01. Example: def insertionSorting(data): for i in range(1, len(data)): temp = data[i] j = i – 1 while j >= 0 and temp < data[j]: data[j + 1] = data[j] …

Read more

Python Program to Implement Binary Insertion Sort

4 December 2022 by zeroones.org

01. Example: def binaryInsertionSort(data): for i in range(1, len(data)): temp = data[i] pos = binarySearch(data, temp, 0, i) + 1 for k in range(i, pos, -1): data[k] = data[k – …

Read more

Older posts
Newer posts
← Previous Page1 … Page15 Page16 Page17 … Page36 Next →

Recent Posts

  • Types of Semiconductor Memories
  • Volatile Memory: SRAM and DRAM
  • 4×1 Multiplexer Modeling Using Verilog With Testbench
  • Selection Sort Python Implementations
  • Bubble Sort Python Implementations
© 2025 zeroones, All Rights Reserved.