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]
3 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]3 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
Final one bit l y links are a virus that will corrupt your files do not go on it
diamong [38]

Answer:

ok mk

Explanation:

3 0
2 years ago
Read 2 more answers
Which task can a company perform with intranets
Irina-Kira [14]

Answer:

C.) store data securely would be my choice

Hope This Helps!  Have A Nice Day!!

6 0
3 years ago
The term ____ is a technical term for the region of memory that holds data waiting to be transferred from one device to another.
shutvik [7]
<span>buffer is what your looking for    my friend made this  it should help  https://quizlet.com/20507517/ch-4-operating-systems-and-file-management-flash-cards/</span>

8 0
3 years ago
NEED HELP ASAP!!!
Triss [41]

Answer:

Feet & Inches

4). Millimeters

5). Pixels

3 0
2 years ago
Who conceptualizes the design and the working of a website
Citrus2011 [14]
Answer is "Web Designer".

Web Designers are the "artists" of the website. They conceptualize the layout and functionality of the site, from features to format. They may do little coding, and are mostly involved in the creative elements of web design. The Web Developer is less big-picture, and more knitty-gritty building of the website. She is the one who does the coding and actually builds the website, using the web designer's model. 
3 0
3 years ago
Other questions:
  • With a _____ network connection, the computers and other devices on the network are physically connected via cabling to the netw
    10·2 answers
  • What are the features of the Outline view in Word? Select three options.
    12·2 answers
  • Signs of mastery include?
    10·1 answer
  • You’re browsing the internet and realize your browser is not responding. Which of the following will allow you to immediately ex
    11·1 answer
  • Which table attributes would this code produce?
    15·1 answer
  • Face book suggests Friends for users based on their
    13·1 answer
  • it refers to the ability of different parts of a computer to work together as one. please answer this​
    6·1 answer
  • List out the storage measurements units of a computer .<br><br>​
    10·2 answers
  • Multiple Select Which of these are ways a hacker might learn someone's password? Select 3 options. o social engineering keylogge
    12·1 answer
  • Which network device sends data to every device that is connected to it?.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!