Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Answer / Sharad Singh
Here is a solution using a hash table, which can find duplicates in O(n) time:n1. Read each line of the file and convert it to an integer.
2. If the integer is already in the hash table, it's a duplicate. Add it to the hash table otherwise.
| Is This Answer Correct ? | 0 Yes | 0 No |
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
what is ram?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
How main function is called in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is the meaning of int *x[]();?
How a string is stored in c?
What is the benefit of using an enum rather than a #define constant?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What do you mean by a local block?
What is structure padding in c?