Discrete Math
For which values of can we subdivide an equilateral triangle into sub-triangles where each sub-triangle is also equilateral?
Prove that every integer greater than 1 can be written as the product of primes.
How many chicken nuggets can you buy exactly using denominations of 6, 9, and 20 pieces? Prove that you can buy exactly chicken McNuggets for all .
Find the sum of from to .
Find the sum of from to .
Find the sum of from to .
Find the sum of the first 100 terms of the sequence given by .
Calculate the sum of the first four terms of the sequence given by .
Determine the sum of the infinite geometric sequence represented by .
Translate the following predicate logic statement to English: "".
Get the sum of elements of a binary tree using recursion: Calculate root's value, and for each subtree, calculate the sum of its elements until reaching the base case where the node is null.
Get the maximum value in a binary tree using recursion: For each node, determine the maximum value in the left subtree and the right subtree, then return the maximum between root's value, leftMax, and rightMax.
Get the height of a binary tree using recursion: Calculate the height of both subtrees and return 1 plus the maximum between them.
Check if a specific value exists in a binary tree using recursion: Compare with the root's value, check in the left subtree, and in the right subtree.
Reverse a binary tree using recursion: Reverse its left subtree, reverse its right subtree, and swap the left node with the right node.
Give the pre-order, in-order, and post-order traversal of the tree below.