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
bonufazy [111]
4 years ago
7

Contrast and compare: an array, a stack, and a queue. Identify the principal uses of each and give an example.

Computers and Technology
1 answer:
Soloha48 [4]4 years ago
8 0

Answer:

All three of them are linear Data Structures.

A stack is a FILO(First In Last Out) or LIFO(Last In First Out)  type data structure means first inserted element will be the last one to be removed form the stack.Insertion and Deletion is from one end only called head.

ex:-A stack of books on the shelf.

A queue is FIFO(First In First Out) type means the first inserted element will be the first one to be removed.In queue insertion is from the back or tail and removal of elements is done form the front.

ex:-A queue at the ticket counter.

In array each element stored is given an index, by which we can be access the element very easily. We can use this index to modify or store element at that index of the array. i.e any object can be accessed with the right index, unlike queue and stack.

We can access only the front and back in the queue.In stack we can access only the top but in array we can access any element with the index.

You might be interested in
What's the name of the file mainly used to save power point
son4ous [18]
.PPT is the extention for the files downloaded from Powerpoint.
7 0
3 years ago
Read 2 more answers
One of the best ways to shoot a picture is to frame the subject in the middle of the screen or viewer. T or F
Ronch [10]
Your answer is T for True
3 0
3 years ago
Read 2 more answers
Two key components of corporate profitability are _________ and _________.
Maru [420]
I would say that the key components of corporate profitability are firstly to have a solid structure and system which allows the company to be efficient, productive and predictable. the second component should be financial literacy which means that the owner or boss must be aware of the financial situation of the company in order to make good decisions for the business. 
7 0
3 years ago
An operator can be overloaded to define functionality that is drastically different from the original operator.
zvonat [6]
A. True

Explanations:

You can redefine or overload the function of most built-in operators in C++. These operators can be overloaded globally or on a class-by-class basis. Overloaded operators are implemented as functions and can be member functions or global functions. An overloaded operator is called an operator function.
5 0
2 years ago
Adam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correc
Tpy6a [65]

Answer:

This is the game guess the number. The computer ask you. Hey! I have thought of a number in between 1 and 20. Can you guess what the number is? If you predict correct, Computer says you guessed right and in so and so number of times. Or else if your guess is larger than guess than it says your guess is too high and it says too low if guessed number is less than the guess. However, in this program it always says it guessed right in one attempt. Actually, we use here if else ladder, The problem is in this if else ladder expression. It has not been set properly. Hence, Adam needs to check that part of the program.

if guessd_number == guess:

            attempt++

            print( "you guessed right in" +attempt+"attempts)

elif guessed_number < guess:

            attempt++

            print("your guess is too low")

else:

            attempt++

            print("your guess is too high")

And this will be inside a while loop. The problem is definitely here.

Explanation:

The answer is self explanatory.

6 0
3 years ago
Other questions:
  • Marijuana and hashish come from the hemp plant?
    10·1 answer
  • An example of cooler red is
    8·1 answer
  • A frameset should only be used with XHTML true or false
    11·1 answer
  • Discuss the role that Cloud Computing plays in an organization and the potential impact that Cloud Computing has on IT.
    8·1 answer
  • What are some benefits of web-based applications?
    8·2 answers
  • C programming: loading a dictionary into a trie data structure. Why am I segfaulting?
    8·1 answer
  • Desirable workplace habits and skills include:
    14·1 answer
  • Does the colour intesity change of the liquid if you add more baking soda?​
    6·1 answer
  • The rectangle shape in flowchart is used for
    12·1 answer
  • Select the correct answer.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!