Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Investigatio Perpetuum

Nick Ivanov nick-ivanov

💭
Investigatio Perpetuum
View GitHub Profile
@nick-ivanov
nick-ivanov / fakecoin1.cpp
Last active Sep 22, 2020
Determining the weight of a non-fake coin in constant time
View fakecoin1.cpp
#include <iostream>
#include <vector>
using namespace std;
int weigh(int w1, int w2) {
cout << "WEIGHING EVENT" << endl;
return w1 - w2;
}
int main()
@nick-ivanov
nick-ivanov / quicksort.go
Last active Dec 31, 2017
QuickSort using Golang
View quicksort.go
package main
type qsintarray []int
func (q qsintarray) nnQuickSortInt() {
q.nnQuickSortIntWorker(0, len(q) - 1)
}
func (q qsintarray) nnQuickSortIntWorker(start int, end int) {
if start >= end {