Skip to content

jawadsab/MyPrograms

Repository files navigation

MyPrograms

Happy Coding Discover important coding questions with solutions

31/05/2020

#1 given a number return true if its prime else false; #2 given a number N find all primes less than N; #3 given low and high find all prime between low and high #4 given low and high find sum of all primes #5 given a number N print all factors of N in ascending order #6 given a number N find all pairs of its prime factors as (prime factor, its freq)

1/06/2020

#7 given a Integer N print its reverse. Print 0 is overflow 32 bit #8 Convert Binary to Decimal. Input is Binary as string. Return decimal is Integer. #9 Convert Decimal to Binary. Input is Decimal Num as int. Return binary as String. #10 Convert Decimal to Hex. #11 Find GCD of two numbers. #12 Find GCD of two numbers recursively; #13 Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7. Note that 1 is typically treated as an ugly number.

2/06/2020

#14 Find the sum of first N natural numbers using recursion #15 Write a recursive function pow(a,b) to calculate a^b. #16 The problem is to count all the possible paths from top left to bottom right of a mXn matrix with the constraints that from each cell you can either move only to right or down.

3/06/2020

#17 Program to print Fibonnaci series triangle.(FibonacciSeries) Ex: 1 1 2 3 5 8 13 21 34 55 #18 Program to find fibonnaci series of a given number using recursion.(FibonacciSeries) #19 Find whether the given string is palindrome or not.(SentencePalindrome) ex: for palindrome put it up spaced string s can aslso be a palindrome like.. put it up lets gog stel

4/06/2020

#20 write a method to return length of longest substring of unique characters. Ex: "abcdabcbab" o/p= 4 (abcd) #21 Find the left and right rotation of given string by a number k mypencil left rotated by 3 is encilmyp mypencil right rotated by 3 is cilmypen #21 Find if given two strings are anagram. Two strings are anagram is they have same characters with same frequency ex: listen and silent are anagram strings as all characters are same with same freq.

About

Happy Coding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages