We propose an approach to study optimal methods of adaptive sampling recovery of functions by sets of a finite capacity which is measured by their cardinality or pseudo-dimension. Let W ⊂ L q , 0 < q ≤ ∞, be a class of functions on I d := [0, 1] d . For B a subset in L q , we define a sampling recovery method with the free choice of sample points and recovering functions from B as follows. For each f ∈ W we choose n sample points. This choice defines n sampled values. Based on these sampled values, we choose a function from B for recovering f . The choice of n sample points and a recovering function from B for each f ∈ W defines a sampling recovery method S B n by functions in B. An efficient sampling recovery method should be adaptive to f . Given a family B of subsets in L q , we consider optimal methods of adaptive sampling recovery of functions in W by B from B in terms of the quantityDenote R n (W, B) q by e n (W) q if B is the family of all subsets B of L q such that the cardinality of B does not exceed 2 n , and by r n (W) q if B is the family of all subsets B in L q of pseudo-dimension at most n. Let 0 < p, q, θ ≤ ∞ and α satisfy one of the following conditions:Then for the d-variable Besov class U α p,θ (defined as the unit ball of the Besov space B α p,θ ), there is the following asymptotic order e n U α p,θ q r n U α p,θ q n −α/d .