Skip to content

Instantly share code, notes, and snippets.

View tornikegomareli's full-sized avatar

Tornike Gomareli tornikegomareli

View GitHub Profile
@tornikegomareli
tornikegomareli / OperatorOverloading
Created April 19, 2017 16:43
Operator overloading in C++
#include <iostream>
#include <string>
using namespace std;
class Person
{
private:
string Name;
int Age;
@tornikegomareli
tornikegomareli / Stack
Created May 3, 2017 15:59
Data Structures : Stack Implementation
#include <iostream>
using namespace std;
class Stack
{
private:
int *node;
int top, length;
@tornikegomareli
tornikegomareli / AIWP
Created May 5, 2017 07:50
Array Initialization with pointers #164
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void Init(int* Arr, int Size)
{
for (int i = 0; i < Size; i++)
{
@tornikegomareli
tornikegomareli / gist:dbe613caee0202491670216745686cc0
Created May 5, 2017 08:35
Swap Two Array's Address Helping the double Pointer
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void Init(int* Arr, int Size)
{
for (int i = 0; i < Size; i++)
{
@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
{
// რიგი
@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 / 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
#include <iostream>
using namespace std;
struct Elem
{
int data; // მონაცემი
Elem * next, *prev;
};
class List
{
Elem * Head, *Tail;
@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>
@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;