ExploreNeedy      
Enter a long URL to make short:
Share with -
  Feeds
  Technical
  Logical
  Puzzles
  Lectures
  Guestbook
HITS FlyArkaden.dk Free Web Counter

Array Algorithms Question


  1. The array T represents the diameters of various teacups, and the array S, the diameters of saucers, both the arrays sorted in non-decreasing order. The ‘i’th cup (whose diameter is T[i]) can be paired with the ‘j’th saucer (whose diameter is S[j]) if and only if S[j] >= T[i].
  2. Given the sorted arrays ‘S’ and ‘T’, write a program to get max number of pairs.
  3. Write a function that prints a 2-D (m x n) array in spiral order.
  4. Given a string find all the combinations of the characters from the string. Assume that input string will not contain any repetition of characters.
  5. For eg. For string 'ABC', the possible combinations are 'A', 'B', 'C', 'AB', 'AC', 'BC' and 'ABC'
  6. A number is said to be circular if multiplying the number by its unit digit, gives the same number circularly shifted right by 1 position.
  7. Example: 102564 is a circular number, since 102564 X 4 = 410256 (which is 102564 right circulated by 1 position). Implement a function to determine whether a given number is circular.
  8. Given a 2D array, write a program to return the reflection of the array (Mirror image of the Array).
  9. Write a method that prints all n digit positive numbers whose sum of digits is greater than givne 'minDigitsSum'.
  10. For Ex. PrintNumbers(2,16) should print the following numbers ( not necessarily in the same order) : 97, 88, 79, 98, 89, 99
  11. Given a string and a delimiter character, implement 'Split' method, which splits the given string by delimiter character and returns an array of strings.
  12. For Ex. Given string 'AB,CD,EF', and delimiter character as ‘,’ (comma), Split method will return a string array of size 3 containing {AB, CD, EF}.
  13. Implement a function for re-arranging an array of size 2*N which contains elements as [A1, A2, . . . , AN, B1, B2, . . ., BN] to [A1, B1, A2, B2, . . ., AN, BN].
  14. Write function to print the unique partitions of n (1 to n) that are of size m.
  15. For Ex. n=10 and m=4 it should print '7 1 1 1', '6 2 1 1', '5 3 1 1', '4 4 1 1', '5 2 2 1', '4 3 2 1', '3 3 3 1', '4 2 2 2', '3 3 2 2'
  16. Write a function to print the next number of the givn number, the next number should contain given set of digits. Ex1: Given Set is (1, 3, 5, 9) and given number is 42, returned next number is 51. Ex2: Given set is (2, 3, 4, 5, 8) and given number is 49, returned next number is 52.
Prev Array Questions
If you think that an important C/C++ Doubly Linked List interview questions or some answers are wrong in the site please contribute it to SiteAdmin@ExploreNeedy.com