23 Mar PMCA Friday 19:00 Python Homework 20.03.20.
Question 1:Write a function buildTree that returns a tree using the nodes and references implementation (BinaryTree class) we learned in the class that looks like this:: ...
Question 1:Write a function buildTree that returns a tree using the nodes and references implementation (BinaryTree class) we learned in the class that looks like this:: ...
Question 1:Using the binaryTree() and other helper functions we made in the class. If we run the following code, please print the binary tree as list: r = binaryTree('a') insertLeft(r,'b') insertRight(r,'c') insertRight(getRightChild(r),'d') insertLeft(getRightChild(getRightChild(r)),'e') And also please draw the tree graph. Question 2:Write a function buildTree() that returns a tree using the list...
Question: ...
Problem DescriptionAnnie has two favourite baseball teams: the Eagle and the Warrior. She has followed them throughout the season, which is now over. The season lasted for N days. Both teams played exactly one game on each day. For each day, Annie recorded the number of...
Problem DescriptionYour new cellphone plan charges you for every character you send from your phone. Since you tend to send sequences of symbols in your messages, you have come up with the following compression technique: for each symbol, write down the number of times it...
Problem DescriptionA common problem in mathematics is to determine which quadrant a given point lies in. There are four quadrants, numbered from 1 to 4, as shown in the diagram below:For example, the point A, which is at coordinates (12, 5) lies in quadrant 1...
Problem DescriptionSuppose we have a number like 12. Let’s define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200....
Problem DescriptionA palindrome is a word which is the same when read forwards as it is when read backwards. For example, mom and anna are two palindromes. A word which has just one letter, such as a, is also a palindrome. Given a word, what is the...
Problem DescriptionWe have learn how to use stack to solve some problems and how to convert decimal number into binary number: Please write the program to convert a given decimal number into a binary number by using the following steps for python coding solutions: takes an argument...
Problem DescriptionAnna and Jack are playing a game. Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During one round, each player rolls one die. The player with the lower roll loses the number of points shown on...