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

which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

1401


What is a program flowchart and how does it help in writing a program?

643


What should malloc(0) do?

601


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

561


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2846






Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

588


What is meant by type specifiers?

647


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

1550


What are the two forms of #include directive?

630


What are pointers? What are stacks and queues?

565


cavium networks written test pattern ..

3576


What does 3 periods mean in texting?

585


regarding pointers concept

1559


How was c created?

581


How can I change the size of the dynamically allocated array?

614