In this paper the relation between Pommaret and Janet bases of polynomial
ideals is studied. It is proved that if an ideal has a finite Pommaret basis
then the latter is a minimal Janet basis. An improved version of the related
algorithm for computation of Janet bases, initially designed by Zharkov, is
described. For an ideal with a finite Pommaret basis, the algorithm computes
this basis. Otherwise, the algorithm computes a Janet basis which need not be
minimal. The obtained results are generalized to linear differential ideals.