Given an array of size N in which every number is between 1
and N, determine if there are any duplicates in it. You are
allowed to destroy the array if you like.
Answer Posted / monika
the formula given for summation shud be (n*(n+1))/2
but it will solve the problem only if we have one duplicate.
if we have many duplicates then we can still get the
correct summation
for ex:
1 2 2 5 5
it has two duplicates but still total is 5*(5+1)/2=15
Is This Answer Correct ? | 28 Yes | 12 No |
Post New Answer View All Answers
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
Write a routine to implement the polymarker function
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Design an implement of the inputs functions for event mode
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
What is data _null_? ,Explain with code when u need to use it in data step programming ?
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
Write a program to model an exploding firecracker in the xy plane using a particle system
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??
why nlogn is the lower limit of any sort algorithm?
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.