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
Node* deleteNode(int value,Node* node){
if(node==NULL){
return node;
}else if(value< node->data){
//value is less than node data
node->left = deleteNode(value,node->left);
}else if(value>node->data){
//value is more than node data
node->right = deleteNode(value,node->right);
}else{
@mirsahib
mirsahib / BST_display_Nth_Largest.cpp
Last active November 20, 2017 11:38
display nth largest element
#include <iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
};
@mirsahib
mirsahib / Queue.cpp
Created November 4, 2017 14:59
Assignment_5
#include <iostream>
using namespace std;
class Queue{
private:
int Front;
int Rear;
int length;
int num_array[100];
@mirsahib
mirsahib / Stack.cpp
Last active November 4, 2017 14:58
Assignment_5
#include <iostream>
using namespace std;
class Stack{
private:
int top;
int num_array [100];
public:
Stack(){
@mirsahib
mirsahib / Assignment_4.cpp
Last active October 27, 2017 16:38
double linked list delete function
/*
Author: Mir Sahib
ID: 1510175
Assignment_4
*/
#include <iostream>
using namespace std;
struct node{
int data;
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int row=10, num;
cin>>num;//if you take row as a input the program will have a bug
int *arrayList = new int[row];
void insertBeforeParticularItem(int searchVal,int val){
int counter = 0;
if(head == NULL){
cout<<"List is empty"<<endl;
}else{
curr = head;
node* prev = NULL;
while(curr!=NULL){
if(curr->data==searchVal){
node *newNode = new node;
@mirsahib
mirsahib / install-firefox-linux.md
Created October 16, 2017 06:49 — forked from stephenharris/install-firefox-linux.md
Installing a particular version of firefox on Linux.

Installing a particular version of FireFox on Linux

  1. Does an existing version of firefox exist?

    firefox --version
    

    If not, skip to (3).

@mirsahib
mirsahib / singlyList.cpp
Last active October 14, 2017 14:13
draft of singly linked list
//============================================================================
// Name : LinkedList.cpp
// Author : Mir Sahib
// Version : 0.1(beta)
// Copyright : MIT License
// Description : Singly Linked List implementation
//============================================================================
#include <iostream>
@mirsahib
mirsahib / Bug_LinkedList.cpp
Last active October 12, 2017 08:33
Bug in addAt
void addAt(int index,int val){
temp = new node;
temp->data = val;
int y = temp->data;
temp->next = NULL;
y = temp->data;
if(head==NULL){
cout<<"The list is empty"<<endl;
y=temp->data;
}else if(index==0){