Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Given an array of length N containing integers between 1
and N, determine if it contains any duplicates.

Answer Posted / ash

If the question is just to find just whether there are
duplicates in the array, we can just sum all the numbers
and if the sum is less than n(n+1)/2, some number in the
array has repeated.

Is This Answer Correct ?    8 Yes 39 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

23904


Explain the difference between #include "..." And #include <...> In c?

1088


Explain what are reserved words?

1160


Tell me what are bitwise shift operators?

1172


What is typeof in c?

1060


What does a function declared as pascal do differently?

1222


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2183


What are variables c?

1093


What does c mean before a date?

1229


Are pointers integer?

1072


In c language can we compile a program without main() function?

1179


What is stack in c?

1122


What is maximum size of array in c?

1085


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1293


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1133