What are the average number of comparisons required to sort
3 elements?
Answer Posted / jaiprakash
n(n-1)/2(bubble sort)
n=3
(3*2)/2=3(n)
ans:n
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
What is the purpose of the statement: strcat (S2, S1)?
Sir i need notes for structure,functions,pointers in c language can you help me please
Is sizeof a keyword in c?
What is selection sort in c?
What is substring in c?
What functions are used in dynamic memory allocation in c?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
Why should I prototype a function?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
State the difference between x3 and x[3].
How will you find a duplicate number in a array without negating the nos ?
Where are c variables stored in memory?
What are the data types present in c?
How many levels of indirection in pointers can you have in a single declaration?