Skip to content

Instantly share code, notes, and snippets.

View jgorczynski's full-sized avatar
🎯
Diving into cloud engineering

Jakub Górczyński jgorczynski

🎯
Diving into cloud engineering
View GitHub Profile
@jgorczynski
jgorczynski / bubble.cpp
Last active March 16, 2018 21:17
bubble random
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <windows.h>
#include <chrono>
using namespace std;
void bubblesort(int tab[], int n)
{
#include <iostream>
#include <cstdlib>
using namespace std;
void selection_sort(int tab[], int n)
{
int mn_index;
for(int i=0; i<n-1; i++)
{
mn_index = i;
#include <iostream>
#include <cstdlib>
using namespace std;
int *pom;
void scal(int tab[], int lewy, int srodek, int prawy)
{
int i = lewy, j = srodek + 1;
#include <iostream>
using namespace std;
void quick_sort(int *tab, int lewy, int prawy)
{
if(prawy <= lewy) return;
int i = lewy - 1, j = prawy - 1;
int pivot = tab[(lewy + prawy)/2]; //punkt odniesienia
while(1)
#include <iostream>
#include <cstdlib>
using namespace std;
void bubblesort(int tab[], int n)
{
for(int i=0; i<n;i++)
for(int j=1; j < n-i; j++)
if(tab[j-1] > tab[j])
swap(tab[j-1], tab[j]);
@jgorczynski
jgorczynski / stack_heap_chrono.cpp
Last active February 26, 2018 19:57
stack_heap_chrono
#include <iostream>
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <malloc.h>
const int SIZE = 1024*1024;
void measure( const char *name, char *ptr ) {
std::cout << "measuring for " << name << " (addr: " << static_cast<void*>(ptr) << ")\n";
#include <iostream>
using namespace std;
int main()
{
double R;
double nominaly[] = {100, 50, 20, 10, 5, 2, 1};
cout << "Wprowadz reszte: ";
cin >> R;
for(int i=0; i<7; i++)
#include <iostream>
#include <vector>
using namespace std;
enum e_brand{bmw = 1, audi, opel, peugeot, seat};
enum e_color{black = 1, white, red, blue, green};
struct car
{
e_brand brand;
@jgorczynski
jgorczynski / three-digit-numbers_sum.cpp
Last active October 2, 2017 18:13
suma_trzycyfrowych created by KubaGorczynski - https://repl.it/Lwq8/10
//a program that gives a sum of three-digit-numbers with different digits.
#include <iostream>
//#include <conio.h>
int main()
{
int sum = 0;
for (int s = 1; s <= 9; s++)
@jgorczynski
jgorczynski / multiplication_loop.cpp
Created September 23, 2017 09:42
multiplication_loop created by KubaGorczynski - https://repl.it/L5aY/0
#include <iostream>
using namespace std;
int main()
{
int a,n,i,product;
product = 1;
cout << "How many numbers do you want me to multiply: ";
cin >> n;