A Linear-time Majority Tree Algorithm