2017 universities Ranking in Pakistan

Here are overall top universities of Pakistan.Some universities are at the top place in engineering fields but others are at Applied science, BA and in IT programs

Tuesday, 23 October 2018

Implementation of "STACKS" using arrrays (Data structure)

#include <iostream> #include <cstdlib> using namespace std; int stackarr[5]; int size=5; int top=-1; /***************************************************/ void push(int item) {     if(top==size-1)     {         cout<<"\n Stack is Overflow:"<<endl;     }     else     {         top++;         stackarr[top]=item;  ...

Saturday, 20 October 2018

Quick sorting program

Worse case performance: O(n^2) Best case performance: O(nlogn) Average performance: O(nlogn) #include <iostream> void quicksort(int arr[],int low,int high); int partition(int arr[],int low,int high); using namespace std; /***********************************/ int partition(int arr[],int low,int high) {     int pivot,i;     pivot=arr[high];     i=low-1;     for(int j=low; j<high; j++)    ...

Thursday, 18 October 2018

Merge sorting program in C++

#include <iostream> using namespace std; /****************************************************************************************************/ void merg(int *arr,int first,int last) {     int mid=(first+last)/2;  int i=first;  int j=mid+1;  int k=first;  int temp[100];     while(i<=mid && j<=last)     {         if(arr[i]<arr[j])      ...

Wednesday, 10 October 2018

Insertion sorting using pointers and function

Normal 0 false false false EN-US X-NONE X-NONE ...

Operation with dynamically 2-D arrays

Write a menu driven program to do following operation on two dimensional arrays dynamically created at run time depending upon user’s requirement. Take the size of arrays from user. The size of first array is nxl, the size of second array is lxm. The arrays need not to be only square in size.    1. Add the contents of the two array A and B and store it in third array C.   2. Multiply array A and B and store the results in another...