Skip to content

Instantly share code, notes, and snippets.

View Ctoic's full-sized avatar
:octocat:
On a mission 🧑🏻‍💻

Najam Ali Abbas Ctoic

:octocat:
On a mission 🧑🏻‍💻
View GitHub Profile
@Ctoic
Ctoic / Postfixevaluation.cpp
Created November 3, 2022 14:54
This Code Contain how to evaluate a post-fix expression. It is Important because computers understand post-fix faster than Infix.
#include<bits/stdc++.h>
using namespace std;
float scanNum(char ch){
int value;
value = ch;
return float(value-'0');//return float from character
}
int isOperator(char ch){
if(ch == '+'|| ch == '-'|| ch == '*'|| ch == '/' || ch == '^')
return 1;
@Ctoic
Ctoic / Converter_infix_postfix.cpp
Last active February 28, 2023 08:20
This Gist Contain Source Code for converting an Infix to postfix prefix and finallay evaluate the answer.
#include<iostream>
using namespace std;
class Node
{
public:
char data;
Node* next;
};
//For this code to run properly make a Text.txt file and it will do operations for you thanks ;)
#include<iostream>
#include<fstream>
#include<string>
using namespace std ;
// NOde Containing left and right Child
#include<iostream>
#include<cmath>
using namespace std;
class Polynomial {
private:
class Term {
public:
int exponent;
int cofficient;
#now we will draw shape using python turtle library
import turtle
colors = ['red', 'purple', 'blue', 'green', 'orange', 'yellow']
t = turtle.Pen()
turtle.bgcolor('black')
for x in range(360):
t.pencolor(colors[x%6])
t.width(x//100 + 1)a
t.forward(x)
#include<iostream>
using namespace std ;
class Nodebst
{
public:
int data ;
Nodebst* left;
Nodebst* right;
#include<iostream>
using namespace std ;
class Nodebst
{
public:
int data ;
Nodebst* left;
Nodebst* right;
#when we were kids our senior always drew heart and a sword in it who were the socold Ashiq(lover) of their time
#I'm modren day Ashiq(lover)
#Impress your love by showing them your heart
import turtle
turtle.speed(3)
turtle.bgcolor('black')
turtle.pensize(10)
#You wanna make sketch with pencil No way copy and paste this code and see the magic ;)
# importing libraries
import cv2
import numpy as np
# reading image
img = cv2.imread("bezos.jpg")
# Edges
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
#if you have used paints in your childhood to make star
#python turtle is library providing tools to draw amazing shapes
# Do try and learn to write program with having some fun dude
from turtle import *
bgcolor('black')
color('red', 'yellow')
begin_fill()
while True:
forward(200)