[solved] – Question 80127

Write a function intreverse(n) that takes as input a positive integer n and returns the integer obtained by reversing the digits in n.

Expert Answer


[solved] – Question 80129

Write a function sumprimes(l) that takes as input a list of integers l and retuns the sum of all the prime numbers in l.

Expert Answer


[solved] – Question 8014

Does quicksort use more comparisons than merge sort? Why is it faster if it uses more comparisons?

Expert Answer


[solved] – Question 80140

B-Tree (order of the tree is 3) 5,2,13,3,45,72,4,6,9,22

Expert Answer


[solved] – Question 80141

Draw a B Tree of order 6

Expert Answer


[solved] – Question 80214

Write a program that accepts a number and outputs its equivalent in words.
Ex. Enter a number: 1380Output: One Thousand Three Hundred Eighty
Note: The maximum input number is 3000

Solution 1: if / else if / else conditional statement
Solution 2: switch / case conditional statement

Expert Answer


[solved] – Question 80238

what is the operations research and Stata programming

Expert Answer


[solved] – Question 80239

Write a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed. For example, the value of reverseDigit(12345) is 54321; the value of reverseDigit(5600) is 65; the value of reverseDigit(7008) is 8007; and the value of reverseDigit(-532) is -235.

Expert Answer


[solved] – Question 80245

Consider the following Python function.
def mystery(l):
if l == []:
return (l)
else:
return (l[-1:] + mystery(l[:-1]))
What does mystery([13,23,17,81,15]) return

Expert Answer


[solved] – Question 80246

What is the value of pairs after the following assignment?
pairs = [ (x,y) for x in range(4) for y in range(3) if (x+y)%3 == 0 ]

Expert Answer