Added linear collection and tree algorithms as well as test cases.