Skip to content

Instantly share code, notes, and snippets.

View theahmadzai's full-sized avatar
🐞
-_-

Muhammad Javed theahmadzai

🐞
-_-
View GitHub Profile
@theahmadzai
theahmadzai / queue.cpp
Last active February 3, 2019 19:18
Circular queue
#include <iostream>
using namespace std;
const int total = 6;
int arr[total];
int front = 0;
int rear = 0;
@theahmadzai
theahmadzai / project.cpp
Last active January 14, 2019 04:11
DSA Project
#include <iostream>
#include <string>
#include<fstream>
#include <ctype.h>
#include <stdio.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
@theahmadzai
theahmadzai / addarr.asm
Created January 7, 2019 00:19
ADD ARR1 ARR2 TO RESULT ARRAY
.MODEL SMALL
.STACK 100H
.DATA
ARR_1 DW 5 DUP(0)
ARR_2 DW 5 DUP(0)
ARR_R DW 5 DUP(0)
MSG_INP DB "INPUT: $"
MSG_OUT DB "OUTPUT: $"
.CODE
@theahmadzai
theahmadzai / coal.asm
Last active December 31, 2018 23:03
SUM, AVG, MIN, MAX, HCF, LCM
.MODEL SMALL
.STACK 100H
.DATA
ARR_N DW 10 dup(?)
VAR_SIZE DW ?
MSG_SIZE DB "HOW MUCH ENTRIES: $"
MSG_INP DB "INPUT: $"
MSG_OUT DB "OUTPUT: $"
MSG_SUM DB "SUM: $"
MSG_AVG DB "AVG: $"
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
const int size = 50;
int arr[size];
.MODEL SMALL
.STACK 100H
.DATA
MSG_MENU DB 10,13,"SELECT CONVERT FROM & TO",10,13,"1 - BINARY",10,13,"2 - DECIMAL",10,13,"3 - HEXADECIMAL",'$'
MSG_FROM DB 10,13,"CONVERT FROM: ",'$'
MSG_TO DB 10,13,"CONVERT TO: ",'$'
MSG_INVALID DB 10,13,"INVALID INPUT",'$'
MSG_BINARY DB 10,13,"BINARY: ",'$'
MSG_DECIMAL DB 10,13,"DECIMAL: ",'$'
MSG_HEXADECIMAL DB 10,13,"HEXADECIMAL: ",'$'
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.NumberFormat;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.swing.JButton;
import javax.swing.JFrame;
@theahmadzai
theahmadzai / slider.js
Created November 18, 2018 09:41
jquery slider
const slider = (function($) {
return function (options = {}) {
const container = $(options.container)
const slider = $(options.slider)
const slide = slider.children()
const image = $(options.image)
const slideLength = slide.length
const slideWidth = slide.width()
const slideHeight = slide.height()
@theahmadzai
theahmadzai / stack.cpp
Last active November 13, 2018 23:50
Generic stack
#include <iostream>
using namespace std;
template <typename T>
class Node {
public:
T value;
class Node *next;
@theahmadzai
theahmadzai / AlternatePalindrome.java
Last active December 29, 2018 21:00
Java Problems
public static int[] programm(int[] arr) {
int res[] = new int[arr.length];
for(int i=0; i<arr.length; i++) {
int n=0;
n += ((arr[i] % 100) / 10) * 100;
n += (arr[i] % 10) * 10;
n += ((arr[i] % 100) / 10);
res[i] = n;
}