Skip to content

Instantly share code, notes, and snippets.

@tornikegomareli
tornikegomareli / gist:a2a1f260edf1ef69db12d50d4215b6e9
Created June 2, 2017 14:50
Introduction to Pointers #Little students
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void Fill(int* Array, int Size)
{
for (int i = 0; i < Size; i++)
@tornikegomareli
tornikegomareli / .vimrc
Created May 27, 2017 08:06 — forked from rocarvaj/.vimrc
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@tornikegomareli
tornikegomareli / gist:4f11c638ce6b27beb896ca48b54af46f
Created May 26, 2017 17:37
Abstract Class in C++ and Pure virtual functions
#include <iostream>
#include <memory>
using namespace std;
class Scientist
{
private:
int ID;
double GPA;
@tornikegomareli
tornikegomareli / BST
Last active June 2, 2017 14:52
Binary_Tree implementation/C++
#include<iostream>
using namespace std;
class BST
{
struct node
{
int data;
@tornikegomareli
tornikegomareli / templates
Created May 16, 2017 17:42
template functions
template <typename T>
void print(int a, T b)
{
cout << " a = " << a << endl;
cout << " b = " << b << endl;
}
template <typename T>
void print(int a, T b)
{
cout << " a = " << a << endl;
@tornikegomareli
tornikegomareli / gist:325953e7bcb326842e8ae83bee2bc3ed
Created May 16, 2017 09:29
C - Own realloc function, and original realloc function. Playing with pointers
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include <assert.h>
#include <iostream>
using namespace std;
struct Elem
{
int data; // მონაცემი
Elem * next, *prev;
};
class List
{
Elem * Head, *Tail;
@tornikegomareli
tornikegomareli / Singliy Linked list
Created May 10, 2017 15:56
Singly Linked list implementation in C++
#include <iostream>
using namespace std;
struct Element
{
char data;
Element * Next;
};
// ერთკავშირიანი ჩამონათვალი
class List
@tornikegomareli
tornikegomareli / QueuePriority
Created May 9, 2017 15:55
Implementation of QueuePriority Data Structure
#include <iostream>
#include <string.h>
#include <time.h>
using namespace std;
class QueuePriority
{
int * Wait;
int * Pri;
int MaxQueueLength;
int QueueLength;
@tornikegomareli
tornikegomareli / gist:057bf4c6caaf19759749b411ea84e5f6
Created May 5, 2017 16:02
Queue Data Structure Implementation with sample Array
#include <iostream>
#include <string.h>
#include <time.h>
using namespace std;
class Queue
{
// რიგი