Wednesday, March 16, 2016

Stack Implementation using Linked List

Description:


We can implement stack using array as well as linked list. But array has fixed size therefore we prefer to use linked list because it does not have predefined size.


#include <iostream>
using namespace std;
struct Node{
int value;
Node *next;

};

int main(){

for( int i=0;i<=79;i++){
cout<<'*';
}
cout<<"                     Built & Designed by Arslan Malik Aareez"<<endl;
cout<<"                          www.CWorldbyAS.blogspot.com"<<endl;
cout<<"                     Facebook : www.facebook.com/arslan.ud.din"<<endl;
cout<<"                     Twitter  : www.twitter.com/itsaareez"<<endl;
for( int i=0;i<=79;i++){
cout<<'*';
}

int menu;
int sel;
 
struct Node *p = new Node;
struct Node *head = new Node;
struct Node *r = new Node;
head->next = NULL;
head->value=0;
    ask:
cout<<"Enter Your Choice\n"<<endl;
    cout<<"1. Push"<<endl;
    cout<<"2. Pop"<<endl;
    cout<<"3. Print"<<endl;
    cout<<"4. Exit"<<endl;
    cin>>menu;
    system("cls");
switch (menu){
case 1:
cout<<"Enter Value to Push : ";
cin>>p->value;
p->next = NULL;
system("cls");
head = p;
cout<<"Do you want to push another value?"<<endl;
cout<<"1. Yes"<<endl;
cout<<"2. No"<<endl;

cin>>sel;
system("cls");
    while (sel!=2){
    struct Node *q = new Node;
      cout<<"\nEnter Value to Push : ";    
cin>>q->value;
q->next=NULL;
p->next = q;
    p = p->next;
    system("cls");
        cout<<"Do you want to push another value?"<<endl;
        cout<<"1. Yes"<<endl;
        cout<<"2. No"<<endl;
        cin>>sel;
        system("cls");

    }
    goto ask;

break;
case 2:
p = head;
if (p->next==NULL && p->value == 0){
cout<<"\nStack is Empty\n\n";
}
while (p->next!=NULL){
r = p;
p = p->next;
}
r->next = NULL;
p->value = 0;

goto ask;

break;
case 3:
system("cls");
p= head;

cout<<"Stack contains the following values "<<endl;

while (p->next!=NULL){
if (p->value==0)
{
cout<<" ";
}
else
{
cout<<" "<<p->value;
}

p=p->next;

}
cout<<" "<<p->value;
cout<<"\n";
goto ask;

break;

case 4:
return 0;
break;
}


}

Tips to generate a reasonable revenue from your website

We are living in the age of technology. Now a days we face technology everywhere. To earn money through internet is not a new thing. The people have been earning money on internet in different ways. The most easiest way that people think is earn money through website or mobile app by monetizing their app or website with ads by google or any other network.

Earning money is not much easy as some people think. It demands a lot of time and hard work with determination and devotion.

There is a question which arrives in mind whenever we talk about to earn through a website. Which type of websites can generate revenue? What are the companies who pay for displaying their ads?

First of all I would like to elaborate the key points which should be kept in mind while development of a website. Every website is not able to generate revenue. To generate revenue from website is a fun if your website has a large range of daily visitors. But if you have very small number of visitors, it can be a fatigue for you or just a source of disappointment.

The following points are essential while development of a website. If these points are followed, you are almost near to generate revenue through a website.

  • First phase in development of website is idea for a website. You should have a mind blowing idea for making a website.
  • Your website should be unique.
  • An idea can change your life.
  • While searching an idea it should kept in mind that your idea is feasible.
  • Hire a great programmer to build your website or make a blog using different CMS like blogger.com, wordpress.com, webs.com etc.
  • Your website template should be eye catching and attractive.
  • Website design should be unique.
  • Website design should be modern but simple.
  • Simple is faster and complicated is slower.
  • So choose a simple and user friendly design.
  • A user should be able to use it easily.
  • Your website should have interesting material on it.
  • Material can be related to any category but it should be completely your own work.
  • It should be informative and helpful for others.
  • Visitors should love to spend time on your website.
  • After getting a well developed and designed website,  buy a good domain name and fast hosting service.
  • Optimize your website for search engines (SEO)
  • SEO is the only way to gain a lot of visitors daily
  • The stronger the SEO of your website, the more will be the number of visitors visiting your website.
  • Place ads on your website.
  • Keep posting and updating your website or provide any services to your visitors.
  • Avoid any type of copyright infringement.
In this way you will be owner of a well designed and well developed website and you will be able to generate revenue from it.