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
zvonat [6]
3 years ago
8

Write an algorithm in pseudocode or english that would describe how to use a stack to reverse any list.

Computers and Technology
1 answer:
s2008m [1.1K]3 years ago
3 0
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();

You might be interested in
Characteristics of the printer​
sveticcg [70]
Important printer characteristics include resolution, speed, color, and cache memory.
4 0
3 years ago
We will extend this idea to streams. Write a function called rle that takes in a stream of data, and returns a corresponding str
yarga [219]

Answer:

def rle(data_stream ):

     with open( "data_stream" ) as file:

           container= [ ]

           two_itemlist= [ ]

           while True:

                 container.append( file.readlines )

           file.close( )

                 while container == True:

                         value= container.pop(0)

                         split_value= value.split( " " )

                         while split_value == True:

                              while len( two_itemlist) < 2:

                                    holder = split_value.pop( 0 )

                                    two_itemlist.append( holder )

                              yield two_itemlist

new_list = rle ( new_file )

Explanation:

In the solution above, the defined function is a generator, as it continuously returns a two-element list.

3 0
3 years ago
Study the sentence below
Tanzania [10]

Answer:

call

Explanation:

call is a way for a person to draw attention to the way a person conveys information to someone he wants.

7 0
3 years ago
Read 2 more answers
Give a recursive algorithm for finding the sum of the<br> first n odd positive integers.
Andrei [34K]
I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

function sumOdd(n)
    if n==1 then
        return 1
    end if
    return (sumOdd(n-1))+(n*2-1)
end function
3 0
3 years ago
Explain the statement that relational algebra operators can be composed. Why is the ability to compose operators important
Rzqust [24]

Answer:

It is important because it can promote the construction of relational algebra operators in a more complete, comprehensive and easy way.

Explanation:

The operators' ability to compose allows them to cooperate with each other's arguments, creating large, comprehensive concepts that address issues in a more detailed and consequently correct way. In this case, this interaction that the composition promotes, allows relational algebra operators to be created more easily.

6 0
3 years ago
Other questions:
  • What does an executable file contain? Program instructions written in source code. Program instructions that have been compiled
    15·1 answer
  • An administrator wants to configure hosts to automatically assign IPv6 addresses to themselves by the use of Router Advertisemen
    14·1 answer
  • Your program should first save 10 random numbers from 1-100 to an array called aray
    12·1 answer
  • 1. What runs horizontally and is identified with numbers?
    12·2 answers
  • Who the heII is apsiganocj
    14·2 answers
  • How network diagram help in scheduling a project? Draw activity network diagram as per given
    7·1 answer
  • Can anyone help explain this?
    13·2 answers
  • Describe what a Bank Run is.
    10·1 answer
  • How many pages is 1500 words double spaced 12pt font?
    13·1 answer
  • When using the Internet, do not give out your __________ without your parents' permission. (Select all that apply.)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!