Question: Write a function that tests whether a string is a palindrome. 2. Write a function that merges two sorted lists into a new sorted

Write a function that tests whether a string is a palindrome. 2.

Write a function that tests whether a string is a palindrome. 2. Write a function that merges two sorted lists into a new sorted list. [1,4,6], [2,3,5] [1,2,3,4,5,6]. You can do this quicker than concatenating them followed by a sort. 3. Write a function that rotates a list by k elements. For example [1,2,3,4,5,6] rotated by two becomes [3,4,5,6,1,2]. Try solving this without creating a copy of the list. How many swap or move operations do you need? 4. Write a function that computes the list of the first 100 Fibonacci numbers. The first two Fibonacci numbers are 1 and 1. The n+1-st Fibonacci number can be computed by adding the n-th and the n-1-th Fibonacci number. The first few are therefore 1, 1, 1+1=2, 1+2=3, 2+3=5, 3+5=8. 5. Write a function that takes a number and returns a list of its digits. So for 2342 it should return [2,3,4,2]. 6. Write a function that takes a list of numbers, a starting base b1 and a target base b2 and interprets the list as a number in base b1 and converts it into a number in base b2 (in the form of a list-of-digits). So for example [2,1,0] in base 3 gets converted to base 10 as [2,1]. 7. Write function that translates a text to Pig Latin and back. English is translated to Pig Latin by taking the first letter of every word, moving it to the end of the word and adding 'ay'. "The quick brown fox" becomes "Hetay uickqay rownbay oxfay". 8. Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,...,9 (in this order) such that the result is 100. For example 1+ 2+ 3-4+5 + 6+ 78 + 9 = 100.

Step by Step Solution

3.46 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Palindrome Check java public static boolean isPalindromeString str str strreplaceAllazAZ09 toLowerCase int left 0 int right strlength 1 while left r... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!