Skip to content

Instantly share code, notes, and snippets.

View mirsahib's full-sized avatar
🎯
Focusing

Mir Habib Ul Latif 🇧🇩 🇵🇸 mirsahib

🎯
Focusing
View GitHub Profile
@mirsahib
mirsahib / twoTwo.java
Created September 3, 2015 12:50
[Java]Codingbat-> Array-2 -> twoTwo
public boolean twoTwo(int[] nums) {
int len =nums.length;
boolean result = true;
for(int i =0;i<len-1;i++){
if(len<=1 && nums[0]!=2)return true;
if(len>=2){
if(nums[len-1]==2 && nums[len-2]!=2)result=false;
}
if(nums[i]==2 && nums[i+1]==2)result = true;
}
num = raw_input('Enter \n')
left = num[0:5]
right = num[5:]
left_list = ['00010','00110','01110','11110','00001','00011','00111','01111','11111']
right_list = ['01000','01100','01110','01111','10000','11000','11100','11110','11111']
#import pdb
#pdb.set_trace()
class point2d {
private float x;
private float y;
public point2d(){
this.x=0;
this.y=0;
}
public point2d(float x,float y){
this.x=x;
#include <iostream>
#include <cmath>
using namespace std;
class ComplexNo{
private:
int real;
int img;
public:
class ComplexNo{
private int real;
private int img;
public void getNo(int a,int b){
this.real=a;
this.img=b;
System.out.println("Real number is: "+this.real+"\nImaginary number is: "+this.img+"i");
}
public class TestDocument {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String a = input.nextLine();
String b = "a-";
//when the user input is a- case 1 return false
//case 1
System.out.println(a=="a-"||a=="A-");
import java.io.*;
import java.util.*;
class Student implements Serializable{
private int id;
private String name;
public void getData(){
int i;
String n;
import java.awt.Color;
import java.awt.Toolkit;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import javax.swing.JLabel;
import javax.swing.table.DefaultTableModel;
/*
* To change this license header, choose License Headers in Project Properties.
@mirsahib
mirsahib / karatsuba_pseudocode.txt
Created May 16, 2017 08:58 — forked from anirudhjayaraman/karatsuba_pseudocode.txt
Pseudocode for Karatsuba Multiplication Algorithm
procedure karatsuba(num1, num2)
if (num1 < 10) or (num2 < 10)
return num1*num2
/* calculates the size of the numbers */
m = max(size_base10(num1), size_base10(num2))
m2 = m/2
/* split the digit sequences about the middle */
high1, low1 = split_at(num1, m2)
high2, low2 = split_at(num2, m2)
/* 3 calls made to numbers approximately half the size */
@mirsahib
mirsahib / README-Template.md
Created August 29, 2017 20:15 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites