Menu

(Solved) : Executes U Mathematical Function Code Evaluate 83 Palindrome String Characters Word Phrase Q30017327 . . .

eXEcutes U. What mathematical function does the code evaluate? 83. A palindrome is a string of characters (a word, phrase, or sentence) that is the same regardless of whether you read it forward or backward-assuming that you ignore spaces, punctuation, and case. För example, Race car is a palindrome. So is A man, a plan, a canal: Panama. Describe how you could use a stack to test whether a string is a palindrome 84. Suppose that you read a binary string-that is, a string of os and 1s-one character at a time. Describe how you could use a stack but no arithmetic to see whether the number of os is equal to the number of 1s. When these counts are not equal, state how you could tell which character-o or 1 occurs most frequently and by how much its count exceeds the others 85. Write Java code that displays all the objects in a stack in the order in which they were pushed onto it. After all the objects are displayed, the stack should have the same contents as when you started 86. Revise the implementation of pop so that it does not call peek. 87. Is an implementation of the ADT stack reasonable if the top of the stack is at the end of a chain of linked nodes instead of its beginning? Explain 88. Revise the implementation of pop so that it calls peek 89. If we were to implement a stack of primitives instead of a stack of objects, 9o. If stack is an array that contains the entries in a stack, what is a disadvantage 91. If you use the locations at the end of an array stack for a stacks entries what changes should we make to the method pop? of maintaining the top entry of the stack in stack[0]? before you use the arrays first locations, should the stacks top entry or its bottom entry be in stack[stack.length - 1]? Why?

eXEcutes U. What mathematical function does the code evaluate? 83. A palindrome is a string of characters (a word, phrase, or sentence) that is the same regardless of whether you read it forward or backward-assuming that you ignore spaces, punctuation, and case. För example, Race car is a palindrome. So is A man, a plan, a canal: Panama. Describe how you could use a stack to test whether a string is a palindrome 84. Suppose that you read a binary string-that is, a string of os and 1s-one character at a time. Describe how you could use a stack but no arithmetic to see whether the number of os is equal to the number of 1s. When these counts are not equal, state how you could tell which character-o or 1 occurs most frequently and by how much its count exceeds the other’s 85. Write Java code that displays all the objects in a stack in the order in which they were pushed onto it. After all the objects are displayed, the stack should have the same contents as when you started 86. Revise the implementation of pop so that it does not call peek. 87. Is an implementation of the ADT stack reasonable if the top of the stack is at the end of a chain of linked nodes instead of its beginning? Explain 88. Revise the implementation of pop so that it calls peek 89. If we were to implement a stack of primitives instead of a stack of objects, 9o. If stack is an array that contains the entries in a stack, what is a disadvantage 91. If you use the locations at the end of an array stack for a stack’s entries what changes should we make to the method pop? of maintaining the top entry of the stack in stack[0]? before you use the array’s first locations, should the stack’s top entry or its bottom entry be in stack[stack.length – 1]? Why? Show transcribed image text

Expert Answer


Answer to Executes U Mathematical Function Code Evaluate 83 Palindrome String Characters Word Phrase Q30017327 . . .

OR