palindrome is a string that reads the same forwards as backwards. Using only a xed number of stacks, and a xed number of int and char variables, write an algorithm to determine if a string is a palindrome. Assume that the string is read from standard input one character at a time. The algorithm should output true or false as appropriate

Answers

Answer 1

Solution :

check_palindrome[tex]$(string)$[/tex]

   lower_[tex]$case$[/tex]_string[tex]$=$[/tex] string[tex]$. to$[/tex]_lower()

   Let stack = new Stack()

   Let queue = new Queue();

   for each character c in lower_case_string:

       stack.push(c);

       queue.enqueue(c);

   let isPalindrome = true;

   while queue is not empty {

       if (queue.remove().equals(stack.pop())) {

           continue;

       } else {

           isPalindrome=false;

           break while loop;

       }

   }

   return isPalindrome

Input = aabb

output = true

input =abcd

output = false


Related Questions

Write a program that will ask the user for a set of ten numbers. After all ten numbers have been entered, the program will display the largest and smallest numbers of the data set. The program will then prompt the user whether he/she would like to enter another set of data. When the user indicates he/she is finished entering data sets, the program will finally display the average largest number and the average smallest number for all sets entered.

Answers

Answer:

In Python:

nums = []

larg= []

small = []

while True:

   for i in range(10):

       num = int(input(": "))

       nums.append(num)

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

   larg.append(max(nums))

   small.append(min(nums))

   another = int(input("Press 1 to for another sets: "))

   nums.clear()

   if not another == 1:

       break

   

print("Average Large: "+str(sum(larg)/len(larg)))

print("Average Small: "+str(sum(small)/len(small)))

Explanation:

This initializes the list of input numbers

nums = []

This initializes the list of largest number of each input set

larg= []

This initializes the list of smallest number of each input set

small = []

This loop is repeated until, it is exited by the user

while True:

The following iteration is repeated 10 times

   for i in range(10):

Prompt the user for input

       num = int(input(": "))

Add input to list

       nums.append(num)

Check and print the smallest using min; Check and print the largest using max;

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

Append the largest to larg list

   larg.append(max(nums))

Append the smallest to small list

   small.append(min(nums))

Prompt the user to enter another set of inputs

   another = int(input("Press 1 to for another sets: "))

Clear the input list

   nums.clear()

If user inputs anything other than 1, the loop is exited

   if not another == 1:

       break

Calculate and print the average of the set of large numbers using sum and len    

print("Average Large: "+str(sum(larg)/len(larg)))

Calculate and print the average of the set of smallest numbers using sum and len

print("Average Small: "+str(sum(small)/len(small)))

A slide contains three text boxes and three images that correspond to the text boxes. Which option can you use to display a text box with its
image, one after the other, in a timed sequence?
A. transition
В. table
C. animation
D. slide master
E. template

Answers

The answer is A. Transition.

Answer:

animation

Explanation:

Explain what an IM is,

Answers

Answer: Stands for "Instant Message." Instant messaging, or "IMing," as frequent users call it, has become a popular way to communicate over the Internet

Explanation:

Which are the 2 main elements that’s make up computer architecture?

Answers

Answer:

Explanation:

Computer architecture is made up of two main components the Instruction Set Architecture (ISA) and the RTL model for the CPU.


Ineeedd help please 35 points question

Answers

Answer:

1

Explanation:

The four gates on the left are XNOR gates, their output is 1 if both inputs are equal. This is the case (given), so all inputs to the quadruple AND gate are 1, hence the output is also one.

If a 9V, 7W radio is on from 9am to 12pm. Calculate the amount of charge that flows through it, hence or otherwise the total number of free electrons that pass through at a point at the power supply terminals​

Answers

Answer:

Q=It

and

p=IV

Given, v=9V P= 7W

I=P/V

I =7/9

Also, time(t) from 9am to 12pm is 3hrs

Converting into sec =3×3600

t=10800

Q= 7/9 ×10800

Q =8400C

what is digital literacy? describe three examples of digital literacy skills

Answers

Digital literacy means having the skills you need to live, learn, and work in a society where communication and access to information is increasingly through digital technologies like internet platforms, social media, and mobile device

Examples of Digital Literacy skills:

What is digital literacy?

ICT proficiency.

Information literacy.

Digital scholarship.

Communications and collaborations.

Digital learning.

Digital identity.

6
Suppose the following formula is inputted into Excel:
=MROUND(1/4,100)
The output in the cell will be:
0
0.25
0.2500
1

Answers

Answer:

the output in the cell will be 0,2500

Write a client program ClientSorting2 and in the main() method: 1. Write a modified version of the selection sort algorithm (SelectionSorter()) that sorts an array of 23 strings (alphabetically) rather than one of integer values. Print the array before it is sorted in the main() method, then after it is sorted in SelectionSorter().

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

 public static void SelectionSorter(String[] my_array){

     System.out.print("\nAfter sort: ");

     for (int ind=0; ind < 22; ind++ ){

         int min = ind;

         for (int k=ind+1; k < 23; k++ )

         if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k;  }

         String temp = my_array[ind];

         my_array[ind] = my_array[min];

         my_array[min] = temp;    }

   for (int j=0; j < 23; j++){   System.out.print(my_array[j]+" ");}

    }

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String [] myarray = new String [23];

 for(int i= 0;i<23;i++){ myarray[i] = input.nextLine();  }

 System.out.print("Before sort: ");

 for ( int j=0; j < 23; j++ ){        System.out.print(myarray[j]+" ");    }

 SelectionSorter(myarray);

}

}

Explanation:

This defines the function

 public static void SelectionSorter(String[] my_array){

This prints the header for After sort

     System.out.print("\nAfter sort: ");

This iterates through the array

     for (int ind=0; ind < 22; ind++ ){

This initializes the minimum index to the current index

         int min = ind;

This iterates from current index to the last index of the array

         for (int k=ind+1; k < 23; k++ )

This compares the current array element with another

         if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k;  }

If the next array element is smaller than the current, the elements are swapped

         String temp = my_array[ind];

         my_array[ind] = my_array[min];

         my_array[min] = temp;    }

This iterates through the sorted array and print each array element

   for (int j=0; j < 23; j++){   System.out.print(my_array[j]+" ");}

    }

The main begins here

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

This declares the array

 String [] myarray = new String [23];

This gets input for the array elements

 for(int i= 0;i<23;i++){ myarray[i] = input.nextLine();  }

This prints the header Before sort

 System.out.print("Before sort: ");

This iterates through the array elements and print them unsorted

 for ( int j=0; j < 23; j++ ){        System.out.print(myarray[j]+" ");    }

This calls the function to sort the array

 SelectionSorter(myarray);

}

}

Which of the following is necessary to appreciate features provided by software applications?
a package
O a basic understanding
O a basis of comparison
O coding concepts

Answers

Answer: a basic understanding

Explanation:

In other to appreciate the features that an application has, one must have a basic understanding of what the software is meant to do. That way, when the software does this duty, the person will recognize it and appreciate the software.

For instance, a person who does not understand the basic premise of Quickbooks will not be able to appreciate the various features provided by Quickbooks to make accounting easier for small to medium businesses.

If D3=30 and D4=20, what is the result of the function
=IF(D4 D3, D3-D4, "FULL")?
0-10
O Unknown
O 10
O Full

Answers

Answer:

c. 10

Explanation:

Given

[tex]D3 = 30[/tex]

[tex]D4 = 20[/tex]

Required

The result of: [tex]=IF(D4 < D3,D3-D4,"FULL")[/tex]

First, the condition D4 < D3 is tested.

[tex]D4 < D3 = 20 < 30[/tex]

Since 20 < 30, then:

[tex]D4 < D3 = True[/tex]

The condition is true, so:

D3 - D4 will be executed.

[tex]D3 - D4 = 30 - 20[/tex]

[tex]D3 - D4 = 10[/tex]

Hence, the result of the function is 10

Consider the following two data structures for storing several million words.
I. An array of words, not in any particular order
II. An array of words, sorted in alphabetical order
Which of the following statements most accurately describes the time needed for operations on these data structures?
A. Finding the first word in alphabetical order is faster in I than in II.
B. Inserting a word is faster in II than in I.
C. Finding a given word is faster in II than in I.
D. Finding the longest word is faster in II than in I.

Answers

Answer:

The correct answer is C.

Explanation:

Finding a given word requires the search operation. The search operation is faster in a sorted array compared to an unsorted array. In a sorted array the binary search method is used which runs on logarithmic time while in an unsorted array, there's no other way than linear search which takes O(n) time on the worst case where the required word is not in the array.

The statement which most accurately describes the time needed for operations on these data structures is: C. Finding a given word is faster in II than in I.

What is a binary search?

Binary search can be defined as an efficient algorithm that is designed and developed for searching an element (information) from a sorted list of data, especially by using the run-time complexity of Ο(log n)

Note: n is the total number of elements.

In Computer science, Binary search typically applies the principles of divide and conquer. Thus, to perform a binary search on an array, the array must first be sorted in an alphabetical or ascending order.

In conclusion, the statement which most accurately describes the time needed for operations on these data structures is that, finding a given word is faster in data structure II than in I.

Read more on data structure here: https://brainly.com/question/24268720

what is subnetting. what does subnetting mean

Answers

Answer:

Subnetting is the practice of dividing a network into two or more smaller networks. It increases routing efficiency, enhances the security of the network and reduces the size of the broadcast domain.

Explanation:

You are a Data Scientist at Anthem Blue Cross Blue Shield. You want to check if a patient will develop diabetes. Please write the R code to split the dataframe into test and training data. The proportion of split is 85/15, and the sample stratification needs to be done on the variable - age.

Answers

Answer:

666

Explanation:

You are a Data Scientist at Anthem Blue Cross Blue Shield. You want to check if a patient will develop diabetes. Please write the R code to split the dataframe into test and training data. The proportion of split is 85/15, and the sample stratification needs to be done on the variable

While all pages use HTML code, not all pages are written in

Answers

Is this a question?

*Answer: not much information to answer with*

Answer:

Code Form

Explanation:

wassup anybody tryna play 2k

Answers

Answer:

u dont want the smoke my boy u dont

Explanation:

Answer:

I only play 24k B)))))))))

Suppose you are working as an administrative assistant at a small law firm. Your boss has asked you to send an invitation out to all employees about the upcoming holiday party. You would like to spruce up the invitation with a few festive images and a fancy border. Which file format would allow you to create a visually appealing invitation that can easily be e-mailed?

JPEG

PDF

SVG

TIFF

Answers

Answer:

PDF

Explanation:

Just did the assignment egde 2021

Answer:

It is B: PDF, as shown in the picture below

What is the proper order for the fetch-execute cycle?

Answers

Control Unit – controls all parts of the computer system. It manages the four basic operations of the Fetch Execute Cycle as follows:

Fetch – gets the next program command from the computer’s memory

Decode – deciphers what the program is telling the computer to do

Execute – carries out the requested action

Store – saves the results to a Register or Memory

Arithmetic Logic Unit (ALU) – performs arithmetic and logical operations

Register – saves the most frequently used instructions and data

What is software and explain the five types of software

Answers

Question: What is software and explain the five types of software

Explanation: The system software which is controlled and managed by the use of set of instructions and programs is called software.

Ex: Windows 7/8/10/xp etc...

the  types of software are'

system software and application software

Android.

CentOS.

iOS.

Linux.

Mac OS.

MS Windows.

Ubuntu.

Unix.

Answer:

What is system software and explain its types?

System Software

A system software aids the user and the hardware to function and interact with each other. Basically, it is a software to manage computer hardware behavior so as to provide basic functionalities that are required by the user.

Which examples demonstrate common qualifications for Marketing Information Management and Research careers? Check all that apply.

David has the physical strength to lift products on high shelves.
Alessandra analyzes and interprets information she gathered from surveys.
Eve is good at presenting and explaining information to others.
Franklin is a strong leader who is able to motivate others.
Gene is very organized and tracks information accurately and carefully.
Claire is confident and persuasive, which makes her good at selling products.

Answers

Answer:

2,3,5

Explanation:

Answer: the answer is 2 3 and 5

Explanation:

Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8.

Answers

Answer:

Following are the code to this question:

import java.util.*;//import package

public class Main //defining a class

{

public static void main(String[] axc)//main method  

{

double Loan_Amount,years,Annual_Interest_Rate=5.0,Monthly_Interest_Rate,Total_Amount,Monthly_Payment;//defining variables

Scanner ax = new Scanner(System.in);//creating Scanner class object

System.out.print("Enter loan amount:");//print message

Loan_Amount = ax.nextDouble();//input Loan_Amount value

System.out.print("Enter number of years: ");//print message

years= ax.nextInt();//input number of years value

System.out.printf("   %-20s%-20s%-20s\n", "Interest Rate", "Monthly Payment","Total Payment");//print message

while (Annual_Interest_Rate <= 8.0) //use while loop to calculate Interest rate table

{

Monthly_Interest_Rate = Annual_Interest_Rate / 1200;//calculating the interest Rate

Monthly_Payment = Loan_Amount * Monthly_Interest_Rate/(1 - 1 / Math.pow(1 + Monthly_Interest_Rate,years * 12));//calculating monthly payment

Total_Amount = Monthly_Payment * years * 12;//calculating yearly Amount

System.out.printf("\t %-19.3f%-19.2f%-19.2f\n", Annual_Interest_Rate,Monthly_Payment,Total_Amount);//use print meethod to print table

Annual_Interest_Rate = Annual_Interest_Rate + 1.0 / 8;//use Annual_Interest_Rate to increating the yearly Rate

}

}

}

Output:

Please find the attached file.

Explanation:

In this code inside the class, several double variables are declared in which the "Loan_Amount and years" is used for input value from the user-end, and another variable is used for calculating the value.

In this code a while loop is declared that checks the "Annual_Interest_Rate" value and creates the interest rate table which is defined in the image file please find it.

I need help solving this problem on Picoctf. The question is What happens if you have a small exponent? There is a twist though, we padded the plaintext so that (M ** e) is just barely larger than N. Let's decrypt this: ciphertext. The ciphertext is this. I tried using stack flow and the rsatool on GitHub but nothing seems to work. Do you guys have any idea of what I can do. I need to solve this problem asap

Answers

Explanation:

Explanation:

RSA encryption is performed by calculating C=M^e(mod n).

However, if n is much larger than e (as is the case here), and if the message is not too long (i.e. small M), then M^e(mod n) == M^e and therefore M can be found by calculating the e-th root of C.

Suppose Alice downloads a buggy browser that implements TLS incorrectly. The TLS specification says that, during the handshake, the browser should send a random 256-bit number RB. Instead of picking RB randomly the browser always sends all zeros. Describe an attack that is possible against this buggy browser and how to update the browser so that this attack is no longer feasible.

Answers

Solution :

It is given that Alice downloads the buggy browser which implements a TLS incorrectly. The specification of a TLS states that during a handshake, the browser sends a 256 bit number of RB randomly.

So in this case, a man-n-the-middle attack is possible. It can compromise the confidentiality of Alice. Updating the browser by visiting the website and checking its latest version of the browser or installing some other browser which has a more trust in the market for its security features.

explain the different type of shift register counter ​

Answers

Answer:

Shift registers are also used as counters. There are two types of counters based on the type of output from right most D flip-flop is connected to the serial input. Those are Ring counter and Johnson Ring counter.

There are two types of shift register counters. They are given below:

Ring counter.Johnson ring counter.

What do you mean by Shift register counter?

The shift register counter may be defined as a sequence of a specific number of core registers that are significantly interconnected to one another in order to provide a clock-driven data shift.

A shift register is a set of f FFs that can be connected within the series and the stored data can be moved in the registers sequentially as per the command or instruction is given.

They are also utilized as counters. The type of shift register counter is based on the output from the D flip-flop which is connected to the serial input from the rightmost side.

Therefore, the two types of shift register counters are well mentioned above.

To learn more about Shift register, refer to the link:

https://brainly.com/question/14096550

#SPJ6

Can two computers be assigned to one IP address

Answers

Answer:

two computers cannot have the same public (external) IP address unless they are connected via the same router. If they are connected via the same router, then they can have (share) the same public IP address yet have different private (local) IP addresses

Explanation:

Answer: maybe

Explanations: two computers cannot have the same public (external) IP address unless they are connected via the same router. If they are connected via the same router, then they can have (share) the same public IP address yet have different private (local) IP addresses.

Software as a Service (SaaS) allows users to
remotely access which of the following? Check all
of the boxes that apply.

software

data

applications

Answers

Answer:

Data software provides the best and most powerful software that allows you in the class

Answer:

software

data

applications

(all)

Explanation:

QUESTION 1
Which of the following is an example of firewall?
O a. Notepad
b. Bit Defender internet Security
O c. Open Office
O d. Adobe Reader

Answers

Answer is Bit defender Internet security
B

what is a . com in a web address mean

Answers

Answer:

dot commercial

Explanation:

.edu education

.gov goverment

Answer:

Commercial

Explanation:

what is a software house​

Answers

Answer:  a company whose primary products are various forms of software, software technology, distribution, and software product development. They make up the software industry.

this should be the answer

hoped this helped

NEED HELP ASAP! You are looking for information in the online catalog for your local library. Which field would you not expect to see in a library's catalog or database?
A. Author
B. Title
C. Year
D. Phone number

Answers

Answer:

The answer is D

Explanation:

     

Other Questions
The American Girl catalog began as a concept to introduce today's girls to girls who lived in the past. Each historically accurate doll is carefully crafted and dressed and has books to describe her life. For example, Kristen is an 1854 pioneer girl who is growing up in Minnesota. Her story begins with her long sea voyage from Sweden. The basic doll dressed in a calico dress and striped apron plus the hardcover story of how she got to Minnesota costs $90. Six more hardback books of Kristen's life are available for $74.95. Kristen's nightgown costs $20, and a matching one for the doll owner is an additional $38. Buy both together and the price is only $50. A hand-painted wooden bed and trunk for Kristen are available for $213. Shipping costs vary with the price of the merchandise ordered. Refer to the American Girl Doll. What is the revenue to American Girl if it sells 20 basic Kristen doll and books John Winthrop defines the Puritan Ideal of Community, while Earle provides an economic and geographic perspective for establishing the English colonies in North America. Discuss the motivations for English colonization of America. Identify a particular group or colony and discuss the political, economic, or social reasons behind their coming to the New World. Explain. A +0.0129 C charge feels a 4110 Nforce from a -0.00707 C charge. Howfar apart are they?[?] m The product of two numbers is 342. If one number is 18, what is the other nnumber without the use of a calculator show all your steps what is the chemical equation for 3fe(s)+4h2o(l)fe3o4(s)+4h2(g) On a test that has a normal distribution, a score of 32 falls three standarddeviations below the mean, and a score of 82 falls two standard deviationsabove the mean. Determine the mean of this test. A bicycle tire holds 1.50 L of air at 5atm and 20.0 C. How many moles of air is this? If the average mass of air is 29.0 g/mol, what is the mass of air in the tire? Which of the following represents a difference between the government of the Roman Republic and that of Imperial Rome?A. In the Roman Republic, the Senate represented the plebeians' views, while in Imperial Rome, the Senate represented the emperor's view.B. In the Roman Republic, the Senate represented the patricians' views, while in the Imperial Rome, the Senate represented the emperor's views.C. In the Roman Republic, the Senate represented the Consuls' views, while in Imperial Rome, the Senate represented the emperor's views.D. In the Roman Republic, the Senate represented the emperor's views, while in Imperial Rome, the Senate represented the Consuls' views. Describe what you normally do on Sunday Inside a human stomach, hydrochloric acid is important in digestion. Which reason best explains why the enzymes found in other partsof the body would not function well in the stomach?a. The temperature is too highb. There is not enough waterC. The pH is too acidic d. There are not enough substrates True or False: When conducting a survey of a group of people, you must interview every person in that population A Truc B False Which of the following is a form of ethnic segregation that persists in theUnited States?A. Immigrants are required to live together until they have becomenaturalized citizens.B. A federal law requires ethnic groups to live together until theylearn to speak English.OC. Many American Indians still live on reservations where their tribeshad been relocated by force.O D. Strong leaders encourage their followers to live together so that they can control them more easily. A. y=-2x+6B. y=2x +6C. y= -1/2x +6D. y=1/2x+6 someone help me on these two 2 Help my dum b brain cant handle this right now What is the answer for this is it a B C or D A pool manager balances the pH level of a pool. The price of a bucket of chlorine tablets is $90, and the price of a pH test kit is $11. The manager uses a coupon that applies a 40% discount to the total cost of the two items. How much money does the pool manager pay for each item? Find b given that A (-6, 2), B (b, 0), and C (3,-4) are collinear. Help please!!!!!!!!!! Which of the following equations is represented by a line passing through (-9, 7) and (3, 3) in thestandard (x, y) coordinate plane?