[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

which is better stack, linklist or dynamic Array of classes

Asked by anshuma in C++ Programming Language, Microsoft Visual C++

Tags: array, link, linklist

/*
I have made a following link list. Now linklist implements Lifo.  To implement fifo , I need to use a STACK.

Now can somebody tell me what are the specific situations where I will use a link list or a Stack or a dynamic array of classes.

I think in case of link list we have the advantage of adding or deleting a node .

Please clear tell all.

Second if I want to sort the data of student based on name . How do I go about it. Should I store all the records in a temporary array and then use bubble sort.
    Till date I have not used STL and heard that VC++ compiler doesn't support can you tell me how to use qsort function of STL.


Last I am still not clear about deleting the nodes. Say I have to delete a specific node with the name x2. How do I do that.
 
*/



#include <iostream>
#include <string>

using namespace std;


class student

{

private:
    string name;
public:
      void setname(string k)
      {
      name=k;
     
     
      }
      void printname()
       {
       
       cout<<name<<endl;
       }

};



class link

{
public:
student data;
link *next;


};

typedef link* lptr;

class linklist

{
private:
 lptr first;
public:
    linklist()
    {
    first=NULL;
   
    }

void additem (student d);
void display();

};


void linklist::additem(student d)

{

//imp statement creation of new link
     
     lptr newlink = new link;

newlink->data=d;
newlink->next=first;
first=newlink;

}


void linklist::display()
{

    lptr current= first;


    while(current !=NULL)

    {
   
    current->data.printname() ;    
    current=current->next;
   
    }

}



void main()
{

linklist li;

student x1,x2,x3;

x1.setname("x1");
x2.setname("x2");
x3.setname("x3");


li.additem(x1);
li.additem(x2);
li.additem(x3);

li.display();


}
[+][-]03/19/03 03:25 PM, ID: 8170443Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: C++ Programming Language, Microsoft Visual C++
Tags: array, link, linklist
Sign Up Now!
Solution Provided By: Catalepsy
Participating Experts: 2
Solution Grade: A
 
[+][-]03/19/03 02:50 PM, ID: 8170259Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/03 02:55 PM, ID: 8170277Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/03 03:06 PM, ID: 8170328Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/03 03:33 PM, ID: 8170484Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/03 03:34 PM, ID: 8170486Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/24/03 03:42 PM, ID: 8199073Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/24/03 04:57 PM, ID: 8199540Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/24/03 05:02 PM, ID: 8199561Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/26/03 06:39 PM, ID: 8215016Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92