This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: RPAL function called "power" to achieve the same functionality. For example (power 3 2) returns the same value as (2**3), which is 8. Your function should use the fact that x 2 n = ( x 2 ) n to reduce the number of multiplications required. You are not allowed to use "**" operator in the function. (Note: Please submit a separate "p3.rpal" with your function for Problem 3. Your "p3.rpal" should be able to pass the RPAL interpreter. It may helps a lot if you try your function in a RPAL inter-preter before you hand it in) 4 Problem 4 Implement a function "merge" which takes two lists of numbers in increasing order and merges them into one list of numbers in increasing order. For example, merge((1,3,4,7),(2,4,6,7,8)) = (1,2,3,4,4,6,7,7,8). (Note: You can assume the input lists are always in increasing order. Please submit a separate "p4.rpal" with your function for Problem 4. Your "p4.rpal" should be able to pass the RPAL inter-preter.) 2...
View Full Document
This note was uploaded on 01/22/2012 for the course COP 5555 taught by Professor Staff during the Fall '08 term at University of Florida.
- Fall '08