menu
Qammunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.
Ask a Question
Questions
Unanswered
Tags
Ask a Question
Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.
asked
Jul 24, 2018
147k
views
1
vote
Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.
Computers & Tech
college
Atu
asked
by
Atu
8.2k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
2
votes
int data[n];
int rev[n];
for (i=0; i < n; i++)
stack.push(data[n]);
for (i=0; i <n; i++)
rev[i] = stack.pop();
Jerome Escalante
answered
Jul 30, 2018
by
Jerome Escalante
7.6k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Dec 22, 2021
190k
views
Write an iterative algorithm in Java-like pseudocode for printing a singly linked list in reverse in O(N) time. You can use as much extra space as you need. The original list pointers CAN NOT BE MODIFIED.
JHeni
asked
Dec 22, 2021
by
JHeni
8.6k
points
Computers & Tech
college
1
answer
4
votes
190k
views
asked
May 7, 2024
14.5k
views
Write a pseudocode function TOSTACK(q) that takes a queue q and returns a stack such that the head of the queue is the same element as the top of the stack. For example, TOSTACK([a, b, c]) = .
Aleksandar Dimitrov
asked
May 7, 2024
by
Aleksandar Dimitrov
8.1k
points
Computers & Tech
high-school
1
answer
3
votes
14.5k
views
asked
May 27, 2021
235k
views
Give the pseudocode of a data structure that supports the stack push and pop operations, and a third operation findMin, which returns the smallest element in the data structure, all in O(1) worst-case
HereGoes
asked
May 27, 2021
by
HereGoes
8.2k
points
Computers & Tech
college
1
answer
4
votes
235k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.4m
questions
12.2m
answers
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qammunity.org