Algorithms for linear time reconstruction by discrete tomography