Assignment Julia 2
1. Write each of the following pure functions on LinkedList
.
- Test if a list is sorted in ascending order.
- Merge two sorted lists.
- Test if a list is cyclic.
- Remove duplicates from a sorted list.
- Test if a list is palindromic.
2. Write each of the following functions on a binary tree with a given root of the type BTree
.
- Return the in-order traversal of a tree as a list.
- Test if a binary tree is symmetric (a binary tree is symmetric if rotating it about the vertical bar through the root for 180 degrees gives the same tree).
- Return the maximum path sum (the sum of the path from the root to a leaf is the sum of values in the nodes on the path).
- Test if a binary tree is a search tree.
- Test if a given value occurs in a binary search tree.
- Insert a value into a binary search tree such that the resulting tree remains a search tree.