You have 2 arrays each containing a set of numbers. Write an algorithm that gets the elements present in the first array and missing from the second. It should have n complexity.
Read Answers(11) | 7,237 Views |
This question was asked at Yahoo.
There are set of ip address set of the form
10.10.10.10 - 20.20.20.20 -> cable, USA
20.20.20.21 - 33.32.31.30 -> DSL, Germany
.
.
.
250.250.250.250 - 256.256.256.256 -> cable, France
Which indicates all ip addresses between 10.10.10.10 to 20.20.20.20 are of type ‘cable’ and belong to the country USA, similarly with other ip address set.
Question:
————
Arrange this data into a data structure in such a way that given an ip address (e.g. 21.21.21.21) retrieve the type of service (cable, DSL.. ) and country (USA, Getrmany..) in the fastest possible way.
Note: the number of such ip address sets could be very large. Also for every ip address between the start(10.10.10.10) and end (256.256.256.256) there is a type and country associated.
Read Answers(7) | 7,858 Views |
1) Write a function int round(float x) to round off a floating point num to int.
2)Write a program to swap two integer pointers.
Read Answers(21) | 13,884 Views |
You need to multiply say, 5123 x 3333 (yes, it’s an obvious example) without using calculator etc. How would you go about doing it?
Read Answers(8) | 10,209 Views |
Spiral Traversal - If you were given an array like:
A B C D E
1 2 3 4 5
A B C D E
1 2 3 4 5
The output should be: ABCDE5E54321A1234DCB
need a program for this…
Read Answers(24) | 12,926 Views |
Write a routine that prints out a 2-D array in spiral order.
Read Answers(16) | 9,826 Views |
Write a function that finds the last instance of a character in a string.
Read Answers(12) | 9,134 Views |
Write a function to compute the factorial of a given integer.
Read Answers(19) | 9,578 Views |
Write a function to find the nth item from the end of a linked list in a single pass.
Read Answers(17) | 10,891 Views |
Write an algorithm to draw a 3D pie chart ?
Read Answers(2) | 4,386 Views |