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

Answer Posted / ramkumar

What if the array is

1) 1,2,3,4,5
2) 1,2,2,5,5

both sums to 15!!

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

657


What is the significance of an algorithm to C programming?

598


Explain what are header files and explain what are its uses in c programming?

633


What is the difference between arrays and pointers?

638


What is restrict keyword in c?

649






Can you tell me how to check whether a linked list is circular?

781


Write a code to generate divisors of an integer?

645


How can I find out how much free space is available on disk?

632


How can I sort more data than will fit in memory?

632


How do you search data in a data file using random access method?

841


Tell me when is a void pointer used?

652


Difference between constant pointer and pointer to a constant.

619


Linked lists -- can you tell me how to check whether a linked list is circular?

649


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1742


Which is more efficient, a switch statement or an if else chain?

585