# Tag - natural numbers list

## C Programming – check for pair in A[] with sum as x

Time Complexity: Depends on what sorting algorithm we use. If we use Merge Sort or Heap Sort then (-)(nlogn) in worst case.

## C++ Programming – Generate all binary permutations

Generate all permutations of given length such that every permutation has more or equal 1’s than 0’s in all prefixes of the permutation.

## C++ Programming – Construct an array from its pair-sum array

C++ Programming - Construct an array from its pair-sum array - Algorithm - A pair-sum array for an array is array that contains sum of all pairs in ordered

## Java Programming – Construct an array from its pair-sum array

Java Programming - Construct array from its pair-sum array - Algorithm - A pair-sum array for array is array that contains sum of all pairs in ordered form.

## C++ Programming – Count Distinct Non-Negative Integer Pairs (x, y)

C++ Programming - Count Distinct Non-Negative Integer Pairs (x, y) - Mathematical Algorithms - A Simple Solution is to run two loops. The outer loop

## C Programming – Find the smallest number whose digits multiply to a given number n

C Programming Find the smallest number whose digits multiply to a given number n - Mathematical Algorithms - Given a number ‘n’ find the smallest number ‘p’