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
Debora [2.8K]
2 years ago
8

write a c program to insert and delete values from stack( to perform pop and push operations) using an array data structure

Computers and Technology
1 answer:
Alexxx [7]2 years ago
3 0

Answer:

<u>How to implement a stack in C using an array?</u>

A stack is a linear data structure that follows the Last in, First out principle (i.e. the last added elements are removed first).

This abstract data type​ can be implemented in C in multiple ways. One such way is by using an array.

​Pro of using an array:

No extra memory required to store the pointers.

Con of using an array:

The size of the stack is pre-set so it cannot increase or decrease.

You might be interested in
The 'client area' of a window is the area used to display the contents of the window (thus a title bar or border would lie outsi
Lady_Fox [76]

Answer:

<u>Window.java</u>

  1. public class Window {
  2.    int width;
  3.    int height;
  4.    public Window(int width, int height){
  5.        this.width = width;
  6.        this.height = height;
  7.    }
  8.    public int getWidth(){
  9.        return width;
  10.    }
  11.    public int getHeight(){
  12.        return height;
  13.    }
  14.    public int getClientAreaHeight(){
  15.        return getHeight();
  16.    }
  17. }

<u>Main.java</u>

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        Window win1 = new Window(12, 15);
  4.        System.out.println(win1.getClientAreaHeight());
  5.    }
  6. }

Explanation:

<u>Window.java</u>

There is a Window class with two int type attributes, width and height (Line 1 - 3).

The constructor of this class will take two inputs, width and height and set these input to its attributes (Line 5 - 8). There are two methods getWidth and getHeight which will return the value of attributes width and height, respectively (Line 10 - 16).

The required new method getClientAreaHeight is defined in line 18 -20. This method will call the getHeight method to return the height value of the window (Line 19).

<u>Main.java</u>

We test the Window class by creating one Window instance and call the getClientAreaHeight method and print the return output (Line 1 -6).

We shall see 15 is printed.

4 0
3 years ago
Energía de movimiento de los átomos o moléculas
olasank [31]

Answer:

g

Explanation:

4 0
2 years ago
Which format must a document be saved in to share it between two different word processors?. Select one of the options below as
slava [35]
When two different word processors are used to share a document, the word document must be saved in the compatibility format where some of the aspects of one version is retained and reflected in the other version while others cannot be retrieved due to the alteration or absence of a component. 

6 0
2 years ago
What is the output when you run the following program? print(3 + 7) print("2 + 3")
QveST [7]

print(3+7) will output 10, which is an integer.

print("2+3") will output 2+3, which is a string.

6 0
2 years ago
Point out the wrong statement :
hoa [83]

Answer:

d. None of the mentioned

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models and these are;

1. Platform as a Service (PaaS).

2. Infrastructure as a Service (IaaS).

3. Software as a Service (SaaS).

All of the following statements are true and correct because they are standard internet protocols;

I. Virtual appliances are becoming a very important standard cloud computing deployment object. This depicts the Platform as a Service (PaaS).

II. Cloud computing requires some standard protocols.

III. Cloud computing relies on a set of protocols needed to manage interprocess communications.

8 0
3 years ago
Other questions:
  • Ryan is looking at investment opportunities as a cloud service provider. He wants to invest in a deployment-based cloud model th
    11·2 answers
  • By Carl Sandburg
    6·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • Which of the following is a true statement?
    12·2 answers
  • What is an example of CT SO?
    9·1 answer
  • A college student needs a laptop that can be used while committing on the train and sitting in a lecture
    13·1 answer
  • Mark and his team are working on a project that is due for delivery in the next few days. The team is using project management t
    10·1 answer
  • After Alexandra installed new software, she set it up to perform in a certain way. She is _____. changing the peripherals linkin
    10·1 answer
  • Fill in the Blank
    10·2 answers
  • 9.18 lab: even/odd values in a vector write a program that reads a list of integers, and outputs whether the list contains all e
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!