Skip to content

Instantly share code, notes, and snippets.

View 648trindade's full-sized avatar
🏠
Working from home

Rafael Trindade 648trindade

🏠
Working from home
View GitHub Profile
@648trindade
648trindade / kd_tree.py
Created March 4, 2020 19:45
KD Tree in Pygame
import pygame, random
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
class Kd_tree:
class Axis:
@648trindade
648trindade / MPI_Merge_Sort.md
Last active February 28, 2022 20:42
MPI Merge Sort in C++

MPI Merge Sort in C++

Sort an integer array filled with random numbers, and distributed over MPI nodes.

The maximum array size N for a node must be at least three times smaller than the memory available to the node.

The algorithm is very simple and not optimal:

  • Recursively subdivide node range until we got a single node
  • Sort the subarray on this node
  • Recursively merge arrays from neighbors nodes