Showing posts with label Sir Usman. Show all posts
Showing posts with label Sir Usman. Show all posts

Thursday, 6 December 2012

First assignment given to students from sir usman is Stack Applications.

Program No.1 - Program Conversion from Decimal to Binary Numbers

Program No.2 - Program to perform Balancing Symbol .


#include "stack.h"
#include <stdio.h>
#include <string>
void cnvert()
{
Stack<int> obj(15);
int p;
cout<<"enter number you want to convert into binary"<<endl;
cin>>p;
while(!obj.Is_Full()&&p>0)
{
obj.Push(p%2);
p=p/2;
}

while(!obj.Is_Empty())
{
p=obj.pop();
cout<<p;
}
}

void balance_symbol()
{
int size;
string string;
cout<<"Enter Your Input ";
cin>>string;
size=string.length();
Stack<char> abbasi(size);
for(int i=0; i<size; i++)
{
if(string[i] == '(' || string[i] == '{' || string[i] == '[')
{
abbasi.Push(string[i]);
}
}

for(int i=0; i<size; i++)
{
if(string[i] == ')')
{
if(abbasi.Top() == '(' )
{
abbasi.pop();
if(abbasi.Is_Empty())
{
cout<<"Your Equation Is Balanced:"<<endl;
break;
}
}

else if(abbasi.Top()!= '(')
{
cout<<"Missing Brackets '(':"<<endl;
break;
}
}

else if(string[i] == '}')
{
if(abbasi.Top() == '{' )
{
abbasi.pop();
if(abbasi.Is_Empty())
{
cout<<"Your Equation Is Balanced:"<<endl;
break;
}
goto start;
start:
{

}
}
else if(abbasi.Top()!= '}')
{
cout<<"Missing Parentheses '}'"<<endl;
break;
}
}
else if(string[i] == ']')
{
if(abbasi.Top() == '[' )
{
abbasi.pop();
if(abbasi.Is_Empty())
{
cout<<"Your Equation Is Balanced:"<<endl;
break;
}
}
else if(abbasi.Top()!= '[')
{
cout<<"Missing Square Brackets '[':"<<endl;
break;
}

 
}


}

if(!abbasi.Is_Empty())
{
cout<<"Missing Parentheses '}'"<<endl;
}
system("pause");
}
void main()
{
int n;
cout<<"press '1' to convert decimal no. to binary"<<endl;
cout<<"press '2' to balancing symbol"<<endl;
cin>>n;
if(n==1)
{
cnvert();
}
else if (n==2)
{
balance_symbol();
}

system("pause");
}
There is no doubt that sir Usman is best and disciplined teacher in International Islamic University islamabad.
Is data structure sir usman start to teach Stack at the start of course , then after one or two weaks you should be prepare for first Quiz related to previous study in classes.

Please there is no teacher as good as sir usman in whole university,he struggle and often sometimes live in university from morning to evening.

The First quiz will be from Stack Application .

Conversion From Decimal to Binary Number

void cnvert()
{
Stack<int> obj(15);
int p;
cout<<"enter number you want to convert into binary"<<endl;
cin>>p;
while(!obj.Is_Full()&&p>0)
{
obj.Push(p%2);
p=p/2;
}

while(!obj.Is_Empty())
{
p=obj.pop();
cout<<p;
}
}



Monday, 3 December 2012

If sir usman is teaching you,then Click on the Lick to Download Assignments,Quizes and assignments.
Slides and quizes are always same and assignment is only a little bit diffrent from previous one.
Sir Usman Marks Distribution In DS :

5 % Labs
15% Quizes
10% Assignments
10% Mids
60 Percent Final

Ds Slides :
Click on names to download lectures.

DS Quizes and Solutions:
Sir usman take 56 to 7 quizes and include tp 5.


DS Assignments and Sulotions:
Usman sir give assignments,if you do not submit assignments you will be faiil even you got 60/60 in final.be prepare for demos of assignments becuase its veryt difficult to face sir usman.