In this paper we establish general determinantal representation of generalized inverses and general form of different definitions of rectangular determinants and induced general inverses, in terms of minors of a matrix, satisfying certain conditions. Using this representation we obtain a general algorithm for exact computation of different classes of pseudoinverses: Moore-Penrose and weighted Moore-Penrose inverse, group inverse, $\{1,2,3\}$, $\{1,2,4\}$, $\{1,2\}$ inverses, left/right inverses, Radiæ's and Stojakoviæ's generalized inverses. We also give some examples which illustrate our results.