Käynnissä

Minimum of stack

#include <iostream>

#include <string>

using namespace std;

struct stack {

​int arr[5];

​int top;

} s;

void push(stack & s, int x);

void min(stack s);

int main()

{

​int k;

​[url removed, login to view] = -1;

​bool n = true;

​while (n)

​{

​​int m;

​​cin >> m;

​​switch (m)

​​{

​​case 1:

​​​cin >>k;

​​​push(s, k);

​​​break;

​​case 2:

​​​min(s);

​​​break;

​​default: break;

​​}

​​cout << " \n Do you want to cotin....? press 1 or 0" << endl;

​​cin >> n;

​}

}

void push(stack & s, int x)

{

​if ([url removed, login to view] == 4)

​{

​​return;

​}

​else

​{

​​s.top++;

​​[url removed, login to view][[url removed, login to view]] = x;

​}

}

void min(stack s)

{

​int z;

​if ([url removed, login to view] == -1)

​{

​​cout << "error";

​}

​else

​{

​​z = [url removed, login to view][0];

​​for (int i = 0; i<[url removed, login to view]; i++)

​​{

​​​if ([url removed, login to view][i] < z)

​​​{

​​​​z = [url removed, login to view][i];

​​​}

​​}

​}

​cout << "min is " << z;

}

Taidot: Tieteellinen kirjoittaminen

Näytä lisää: min stack python, min stack interview question, min stack java, find max element in stack, get minimum element from stack geeksforgeeks, min stack interviewbit, min stack c++, design a stack that supports push, pop, top, and retrieving the minimum element in constant time., I want to use a word press, I want to use a word press platform, I want to use a word press platform. I want you to base the design around the logo, Re-design the website. https://www.tracksidepowersports.com/home.html I want to use a word press platform. I want you to base t, This project is ending in 5 days and has an average bid price of €21.00 EUR., Write a public class method chopMiddle that accepts a String parameter with 5 integers in it separated by commas (e.g. “1,2,3,, error 5

Tietoa työnantajasta:
( 0 arvostelua ) Egypt

Projektin tunnus: #15681336

Myönnetty käyttäjälle:

dsourajit

A proposal has not yet been provided

55 $ USD 3 päivässä
(0 arvostelua)
0.0

2 freelancers are bidding on average $63 for this job

70 $ USD 3 päivässä
(1 arvostelu)
1.7