1. Classify the Hashing Functions based on the various methods by which the key value is found
2. Common multipleQ: Given two numbers m and n, write a method to return the first number r that isdivisible by both (e.g., the least common multiple).
3. Array of sizeGiven an array of size n+1 which contains all the numbers from 1 to n. Find the number which is repeated in O(n) time. How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
4. Missing numberGiven an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.
5. Denominations of coinsYou are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
6. Maximum sumGiven an array all of whose elements are positive numbers, find the maximum sum of a subsequent elements with the constraint that no 2 numbers in the sequence should be adjacent in the array. So, 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
7. Convert a decimal numberHow do you convert a decimal number to its hexa-decimal equivalent. Give a C code to do so.
8. Array of size nGiven an array of size n, containing every element from 1 to n+1, except one. Find the missing element.
2. Common multipleQ: Given two numbers m and n, write a method to return the first number r that isdivisible by both (e.g., the least common multiple).
3. Array of sizeGiven an array of size n+1 which contains all the numbers from 1 to n. Find the number which is repeated in O(n) time. How do you proceed with the same with floating numbers from 0 to 1 instead of 1 to n?
4. Missing numberGiven an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.
5. Denominations of coinsYou are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?
6. Maximum sumGiven an array all of whose elements are positive numbers, find the maximum sum of a subsequent elements with the constraint that no 2 numbers in the sequence should be adjacent in the array. So, 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
7. Convert a decimal numberHow do you convert a decimal number to its hexa-decimal equivalent. Give a C code to do so.
8. Array of size nGiven an array of size n, containing every element from 1 to n+1, except one. Find the missing element.
No comments:
Post a Comment