1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Wittaler [7]
4 years ago
11

What is the difference between a queue and a stack?

Computers and Technology
1 answer:
Zinaida [17]4 years ago
7 0

Answer:

Difference between Queue and Stack are as following:-

  1. Queue is a FIFO(First In First Out) type data structure while Stack is a LIFO(Last In First Out) type data structure.
  2. The insertion and deletion of elements from the queue happens from two ends insertion at the tail and deletion from the front.While the insertion and deletion from stack happens from one end only that is top.
  3. The insertion and deletion operation in queue are referred as enqueue and dequeue. While in stack they are referred as push and pop respectively.
You might be interested in
Piers lives in an apartment and has an existing home television connection. He wants to subscribe to a high-speed internet conne
lina2011 [118]

Answer:

D. Wireless Network

Explanation:

A Wireless network has no need for cabling, trunking nor any heavy device installation. a Portable wireless device can solve his problem.

5 0
3 years ago
Betty took her friends bowling. they rented 4 lane. 10 people need rent shoes and
bogdanovich [222]
First there are two groups, members and non-members, so you know that there are 4 people who are members, if you subtract 4 from ten that would mean 6 people are non-members. now, for the cost of the members would be (7.50 × 4) + (2.95 × 4) = 41.8$
for the non-member group or would be (9.75 × 6) + (3.95 ×6) = 82.2$ now add 41.8 to 82.2 which equals 124.0$ in total
4 0
4 years ago
Create a class Student and another called StudentClub. StudentClub should have the fields President, Vice-President, Secretary,
salantis [7]

Answer:

See explaination

Explanation:

StudentClub.h

#ifndef STUDENTCLUB_H_INCLUDED

#define STUDENTCLUB_H_INCLUDED

//#include <vector>

//class student

class Student

{

public:

std::string name;

Student(){}

Student(std::string name)

{

this->name=name;

}

};

//studentclub class

class StudentClub

{

Student* President=new Student();

Student* VicePresident=new Student();

Student* Secretary=new Student();

Student* Treasurer=new Student();

std::vector<Student> clubMember;

public:

StudentClub(Student* p, Student* v, Student* s, Student* t, std::vector<Student> m);

Student* get_president() const;

Student* get_vice_president() const;

Student* get_secretary() const;

Student* get_treasurer() const;

std::vector<Student> get_members() const;

void add_member(Student* s);

int number_members();

};

#endif // STUDENTCLUB_H_INCLUDED

StudentClub.cpp

#include <iostream>

#include <vector>

#include "StudentClub.h"

using namespace std;

//constructor with parameter

StudentClub::StudentClub(Student* p, Student* v, Student* s, Student* t, vector<Student> m)

{

President =p;

VicePresident=v;

this->Secretary =s;

this->Treasurer =t;

this->clubMember=m;

}

//return president

Student* StudentClub::get_president() const

{

return this->President;

}

//return vice president

Student* StudentClub::get_vice_president() const

{

return this->VicePresident;

}

//return secretary

Student* StudentClub::get_secretary() const

{

return this->Secretary;

}

//return treasurer

Student* StudentClub::get_treasurer() const

{

return this->Treasurer;

}

//return memeber

vector<Student> StudentClub::get_members() const

{

return clubMember;

}

//add member

void StudentClub::add_member(Student* s)

{

for(int i = 0; i < clubMember.size(); i++)

{

if(clubMember[i].name == s->name)

return ;

}

this->clubMember.push_back(*s);

}

//return memeber count

int StudentClub::number_members()

{

return clubMember.size();

}

main.cpp

#include <iostream>

#include <vector>

#include "StudentClub.h"

using namespace std;

int main()

{

//declarations

Student p,s,v,t,m;

//get names

cout<<"President: ";

cin>>p.name;

cout<<"VicePresident: ";

cin>>v.name;

cout<<"Secretary: ";

cin>>s.name;

cout<<"Treasurer: ";

cin>>t.name;

vector<Student> cl;

//get members

do{

cout<<"\nNew member (Q to quit): ";

cin>>m.name;

if(m.name!="Q")

cl.push_back(m);

}while(m.name!="Q");

//add to club

StudentClub club(&p,&v,&s,&t,cl);

club.add_member(&p);

club.add_member(&v);

club.add_member(&s);

club.add_member(&t);

//print details

cout<<"\n\nPresident: "<<club.get_president()->name;

cout<<"\nVicePresident: "<<club.get_vice_president()->name;

cout<<"\nSecretary: "<<club.get_secretary()->name;

cout<<"\nTreasurer: "<<club.get_treasurer()->name;

cout<<"\nTotal Members: "<<club.number_members();

return 0;

}

3 0
3 years ago
Your program has a loop where a user guesses a letter.
baherus [9]

Answer:

This code loop depends on what you are actually using, JavaScript, Python? But it normally the user 'input'. Represented as an 'int' (integer). Also, I don't understand this.

5 0
3 years ago
Read 2 more answers
Mac users find lists of commands
gtnhenbr [62]
Here are few commands for Mac:

Command+C ⇔ <span><span>Copies selected items
</span>Command+D </span>⇔ <span>Duplicates the selected item(s)
Command+E </span>⇔ <span>Ejects the selected volume
Command+F </span>⇔ <span>Displays the Find dialog
Command+H </span>⇔ <span>Hides All Finder windows
Command+I </span>⇔ <span>Shows info for selected item or items
Command+J </span>⇔ <span>Shows the view options for the active window
Command+K </span>⇔ Displays the Connect to Server dialog
5 0
3 years ago
Other questions:
  • Your computer has gradually slowed down. What's the most likely reason?
    8·1 answer
  • Explain how applying different network topologies could have an impact on the security of a network
    11·1 answer
  • Mai has recently created her own e-mail account. Her father gave her permission to e-mail her friends and family but warned her
    11·2 answers
  • Dell Computers is a nationally recognized manufacturer of computers for the small business and home markets. If Dell were to ord
    9·1 answer
  • Need help with Brainly!! Thanks in advance for sharing your thoughts or answering any of my questions on this. [][] Firstly, Bra
    14·1 answer
  • What settings are available in the Properties dialog box of a message? Check all that apply.
    6·2 answers
  • What are the uses of plotters​
    7·2 answers
  • The temperature in toronto canada was-4°c and tje temperature in brixton,england was 6°c warmer. what was the difference in temp
    11·1 answer
  • Select the functions in the Insert tab in PowerPoint.
    8·1 answer
  • Which term refers to a shorthand method for identifying network and host bits in an ip address?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!