Find Jobs
Hire Freelancers

Beginner Computer Science Coding- Stacks -- 2

$10-30 USD

Concluído
Publicado há mais de 9 anos

$10-30 USD

Pago na entrega
The stack is a commonly used data structure in computer science. It is an arrangement of data where the last item to be added is the first one to be removed. Think of it as a stack of papers. As you stack papers up, you remove them in the reverse order from which they were added. There are two basic operations for a stack – push and pop. You will see them in the class below. Push is to add an item to the stack and pop must remove an item from the stack. Before we look at the code below, let me suggest that there are at least two boundary conditions that you must address. • One cannot pop from an empty stack as there is nothing to pop • One cannot push to a full stack as there is no more room This assignment is to implement an integer stack as a class using an array. You must also create a main function to test your implementation. I have provided the class structure below to help you get started. You are required to use this structure for this assignment. This solution uses tos as the array index to define the stack. When you push you should increment the tos and when you pop you should decrement tos. I suggest that you don’t change the value of tos during the show function as this will really screw you up. Without further discussion you will find the code for the Stack class on the following page. #define MAXSIZE 10 //set maximum size of stack to 10 integers //You probably will want to add an include or two here class Stack{ private: int stack[MAXSIZE]; //integer array for your stack int tos; //array index to top of stack bool isEmpty(){ if (tos==-1) return true; return false;} bool isFull(){if (tos == MAXSIZE-1) return true; return false;} public: Stack(){tos=-1;} //constructor-initialize tos to -1 //if tos == -1 then stack is empty void push(int i); //Add i to top of stack; int pop(); //Remove and return value from top of stack void show(); //output the stack }; //your code for push, pop, show, and main goes here
ID do Projeto: 6856076

Sobre o projeto

8 propostas
Projeto remoto
Ativo há 9 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
I only ask for 10$. 5$ as initial payment, 5$ as final. The work will be done within 24 hours. If the price and the deadline is acceptable for you, then feel free to contact me for further discussion.
$10 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
8 freelancers estão ofertando em média $37 USD for esse trabalho
Avatar do Usuário
Hi. I've read your description, and this is what i'd done at school. I want to help you. I can do this right away. Thank you.
$54 USD em 1 dia
5,0 (27 avaliações)
6,4
6,4
Avatar do Usuário
Hi there, I've already read and understood the project description, and I'm sure I can complete this one for you. So really hope to have chance to work with you, thanks for your consideration! Regards.
$30 USD em 1 dia
5,0 (71 avaliações)
5,2
5,2
Avatar do Usuário
A proposal has not yet been provided
$30 USD em 1 dia
5,0 (2 avaliações)
2,2
2,2
Avatar do Usuário
I can give you this in few minutes if you want me to do this please ping me. Your work is already done I will send you the screenshot of the working code. Regards
$30 USD em 1 dia
5,0 (3 avaliações)
1,6
1,6
Avatar do Usuário
I have extensive experience in C,C++ programming. I can easily & reliably do your job with lowest cost & minimum time. Message me.
$20 USD em 1 dia
5,0 (1 avaliação)
1,0
1,0
Avatar do Usuário
Hello, We are expertise Dotnet using VB.net and C#, We also make forms like an international design, Not like classic brown style, But if you want then we can do that too. Our logic are always clear and codes are always optimized without any Loopholes. We have done projects on Custom College Accounting Software, Inventory Management Software and also some different tasks, you can check my another project which I have done.. I can create the application with any database.
$20 USD em 1 dia
5,0 (1 avaliação)
0,6
0,6
Avatar do Usuário
A proposal has not yet been provided
$100 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
I'm an experienced programmer and also have a good knowledge of data structures. So, I think I'm eligible for this job.
$30 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
San Bernardino, United States
5,0
1
Método de pagamento verificado
Membro desde dez. 12, 2014

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.