subject

Guidelines:
 Loops are completely banned (for loop and while loop)
 You must use recursion in each function
 You are not allowed to import anything.
 You are not allowed to use the built-in function max(). Everything else is okay
 You are allowed to use sets, dictionaries, and any of their respective operations.
 You are allowed to use any string method except for string. join()
 You can do string slicing, but you cannot use the string[::-1] shortcut.
 You can use any list operation, except for list. sort() and list. reverse()
 Do not hard code to the examples

Functions (You must use recursion in each function WITHOUT altering the original function signature):
def merge(listA, listB):
Description:
Combine two lists into one list, maintaining the order of the elements. You should assume that both lists given to this function contain elements in ascending order (smallest first).
Parameters:
listA, listB, two lists of elements (could be anything – assume homogenous data)
Return value:
a list, the combination of elements from listA and listB in ascending order.
Examples:
merge([1,2,3], [4,5,6]) → [1,2,3,4,5,6]
merge([1,2,3], [2,3,4]) → [1,2,2,3,3,4]
merge([2,4,6], [1,3,5]) → [1,2,3,4,5,6]

def largest_sum(xs, x, y):

Description:
Zig-zag through a two-dimensional list of integers from some starting point until you reach one of the list's boundaries, computing the largest sum that you find along the way. X and Y represent the row and column position in xs of the first number to use in the sum. The zig-zag pattern is made by limiting yourself to only looking at the number immediately on the right of (x, y) and the number immediately below (x, y) when figuring out which of those numbers yields the largest sum.

Parameters: xs, a 2D list of integers, x, y are the row and col position in xs
Return value: an integer, the largest sum you can find from position (x, y)
Examples:
largest_sum([[1,2],[3,0]],0,0) → 4
largest_sum([[5,6,1],[2,3,3]],0,0) → 17
largest_sum([[0,7,5],[6,-1,4],[-5,5 ,2]],0,0) → 18
largest_sum([[0,7,5],[6,-1,4],[-5,5 ,2]],1,1) → 6

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Hey i just logged on and one of the moderators deleted a bunch of my answers to questions, even though the answers were right and the people it doesn't make sense but if anyone wants to talk about anything just message me lol (this is super random lol)
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
You know the right answer?
Guidelines:
 Loops are completely banned (for loop and while loop)
 You must use rec...
Questions
question
Mathematics, 04.04.2020 14:17
question
Mathematics, 04.04.2020 14:18
Questions on the website: 13722360