Skip to content

Instantly share code, notes, and snippets.

View besza's full-sized avatar
🏠
Working from home

Szabolcs Besenyei besza

🏠
Working from home
View GitHub Profile
import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
public class WalkFileTreeDemo {
@besza
besza / upper_triangular_matrix.cpp
Created May 9, 2016 15:39
Transform NxN upper triangular matrix to a 1D row-major vector
#include <stdio.h>
// fhm - felso haromszog matrix
// nxn-es fhm nem-nulla elemeinek a szamossaga
int fhm_elemei(int n)
{
return (n*n + n)/2;
}