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
Makovka662 [10]
4 years ago
14

Suppose we have two String objects and treat the characters in each string from beginning to end in the following way: With one

string, we push each character on a stack. With the other string, we add each character to a queue. After processing both strings, we then pop one character from the stack and remove one character from the queue, and compare the pair of characters to each other. We do this until the stack and the queue are both empty. What does it mean if all the character pairs match?
Computers and Technology
1 answer:
Simora [160]4 years ago
6 0

Answer:

If all the character pairs match after processing both strings, one string in stack and the other in queue, then this means one string is the reverse of the other.                            

Explanation:

Lets take an example of two strings abc and cba which are reverse of each  other.

string1 = abc

string2 = cba

Now push the characters of string1 in stack. Stack is a LIFO (last in first out) data structure which means the character pushed in the last in stack is popped first.

Push abc each character on a stack in the following order.

c

b

a

Now add each character of string2 in queue. Queue is a FIFO (first in first out) data structure which means the character inserted first is removed first.

Insert cba each character on a stack in the following order.

a   b   c

First c is added to queue then b and then a.

Now lets pop one character from the stack and remove one character from queue and compare each pair of characters of both the strings to each other.

First from stack c is popped as per LIFO and c is removed from queue as per FIFO. Then these two characters are compared. They both match

c=c. Next b is popped from stack and b is removed from queue and these characters match too. At the end a is popped from the stack and a is removed from queue and they both are compared. They too match which shows that string1 and string2 which are reverse of each other are matched.

You might be interested in
In general, font size for software-generated presentation slides should be no smaller than __________ points.
hjlf
The smallest you should have is PROBABLY 24 points.  Anything below that is going to strain the audience's eyes!  However, the title text can be a bit bigger, around 36 and then for text anything around 24-26 should work!
5 0
3 years ago
Which statement relating to a Works Cited page is NOT True?
oksano4ka [1.4K]
The incorrect answer is the second one: It is the first page in a research paper.
Works cited pages always come last.
7 0
4 years ago
Read 2 more answers
It's 50 points.
Mashutka [201]

Answer:

When I was younger I had a dream about being popular for my studies. everyone knew that I worked hard and devoted to studies. Two years ago I took an admission to a different school, no one knew I studied well how I hittin famous was quite unique. It was hard for students to carry textbooks, a rule was made for textbooks to be in a cupboard. I was the monitor of the cupboard and had keys for it. once in my mathematics class my classmates were shouting my name "SALENA! SALENA! so I would give them there books. maam out of frustration asked "Who is SALENA!? I raised my hand from behind maam in an embarrassed manner. My teacher noticed me and realized I'm a brilliant student.

Explanation:

I hope you have a nice! I tried to shorten it has much as I could. I hope this helps you!

3 0
3 years ago
Read 2 more answers
You can change the ____ or position of text within a document's margins.
ahrayia [7]

Answer:

Alignment

Explanation:

That should be correct

7 0
3 years ago
How to combine multiple documents into one pdf.
sergeinik [125]

Answer:

How to combine and merge your files into one PDF: Open Acrobat DC to combine files: Open the Tools tab and select "Combine files." Add files: Click "Add Files" and select the files you want to include in your PDF. You can merge PDFs or a mix of PDF documents and other files.

Explanation:

8 0
3 years ago
Other questions:
  • In addition to talking to other doctors remotely, telegraphy technology?
    5·1 answer
  • SecOps focuses on integrating the need for the development team to provide iterative and rapid improvements to system functional
    11·1 answer
  • In the lan protocol architecture the _________ layer is responsible for detecting errors and discarding any frames that are in e
    13·1 answer
  • How do u feel about distance learning in a paragraph?
    6·2 answers
  • Assume that the demand curve for DVD players shifts to the left and the supply curve for DVD players shifts to the right, but th
    6·1 answer
  • Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolut
    12·1 answer
  • How network diagram help in scheduling a project? Draw activity network diagram as per given
    7·1 answer
  • You must regularly do this on your computer to prevent a virus from infecting it​
    9·2 answers
  • 9.6 Code Practice, this is in Python, I need its quick!
    13·1 answer
  • Comment if u wanna text me on behance
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!