Skip to content

Instantly share code, notes, and snippets.

View haridutt12's full-sized avatar
🎯
Focusing

haridutt12

🎯
Focusing
View GitHub Profile
@haridutt12
haridutt12 / binarytree.c
Last active July 12, 2016 04:34
code for binary tree creation and traversal(preorder)
#include<stdio.h>
#include<malloc.h>
struct bt
{
int data;
struct bt *left;
struct bt *right;
};
struct bt* create(struct bt *h)
@haridutt12
haridutt12 / LLstack.c
Created July 10, 2016 15:07
link list traversal using stack
#include<stdio.h>
#include<stdlib.h>
struct node
{
int no;
struct node *next;
}*h,*c,*p;
struct stack
#include<stdio.h>
#include<malloc.h>
struct bt
{
int data;
struct bt *left;
struct bt *right;
};
#include<stdio.h>
struct bt
{
int data;
struct bt *left;
struct bt *right;
};
struct bt* create(struct bt *h)
{
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
while(n>0)
{ long int g;
cin>>g;
while(g>0)
#include <stdio.h>
#include <malloc.h>
struct bt
{
int data;
struct bt *left;
struct bt *right;
};
//creation of bst
/*Kristen loves playing with and comparing numbers. She thinks that if she takes two different positive numbers, the one whose digits sum to a larger number is better than the other. If the sum of digits is equal for both numbers, then she thinks the smaller number is better. For example, Kristen thinks that is better than and that is better than .
Given an integer, , can you find the divisor of that Kristin will consider to be the best?
Input Format
A single integer denoting .
Constraints
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <bits/stdc++.h>
using namespace std;
struct job
{
int start;
int end;
};
bool sorting(job const& lhs, job const& rhs)
{
if (lhs.start != rhs.start)
#include <fstream>
#include <iostream>
#include <limits>
#include <string>
#include <windows.h>
#include <ctime>
#include <bits/stdc++.h>
using namespace std;
template <typename T>