Skip to content

Instantly share code, notes, and snippets.

View nick-ivanov's full-sized avatar
💭
Stand with Ukraine! 🇺🇦

Nick Ivanov nick-ivanov

💭
Stand with Ukraine! 🇺🇦
View GitHub Profile
@nick-ivanov
nick-ivanov / fakecoin1.cpp
Last active September 22, 2020 11:58
Determining the weight of a non-fake coin in constant time
#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 December 31, 2017 02:40
QuickSort using Golang
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 {