If there are n integers to sort, each integer has d digits and each digit is in the set {1,2, ..., k}, radix sort can sort the numbers in: (A) O(d n k) (B) O(d nk) (C) O((d+n)k) (D) O(d(n+k))

1 Answer

Answer :

(D) O(d(n+k))

Related questions

Description : Which of the following algorithms sort n integers, having the range 0 to (n2 -1), in ascending order in O(n) time ? (A) Selection sort (B) Bubble sort (C) Radix sort (D) Insertion sort

Last Answer : (C) Radix sort

Description : An integer constant in C must have A) At least one digit B) At least one decimal point C) A comma along with digits D) Digits separated by commas

Last Answer : A) At least one digit

Description : Which of the following sorting algorithm is in-place a) Counting sort b) Radix sort c) Bucket sort d) None

Last Answer : b) Radix sort

Description : Let R be a relation on the set of integers given by a = 2^k .b for some integer k. Then R is -Maths 9th

Last Answer : (c) equivalence relationGiven, a R b = a = 2k .b for some integer. Reflexive: a R a ⇒ a = 20.a for k = 0 (an integer). True Symmetric: a R b ⇒ a = 2k b ⇒ b = 2-k . a ⇒ b R a as k, -k are both ... = 2k1 + k2 c, k1 + k2 is an integer. ∴ a R b, b R c ⇒ a R c True ∴ R is an equivalence relation.

Description : Write the given sets in roster form: (a). P = {y: y is an integer and -4 < y < 6}. (b). Q = {y: y is a natural number which is

Last Answer : (i) A = {x: x is an integer and †3 < x < 7} The elements of this set are †2, †1, 0, 1, 2, 3, 4, 5, and 6 only. Therefore, the given set can be written in roster form as A = {†2, †... and 80 only. Therefore, this set can be written in roster form as C = {17, 26, 35, 44, 53, 62, 71, 80}}.

Description : Which of the following is/are not true? (a) The set of negative integers is countable. (b) The set of integers that are multiples of 7 is countable. (c) The set of even integers is countable. (d) The set of real numbers between 0 ... . (A) (a) and (c) (B) (b) and (d) (C) (b) only (D) (d) only

Last Answer : (D) (d) only

Description : When the celebrated German mathematician Karl Friedrich Gauss (1777-1855) was nine he was asked to add all the integers from 1 through 100. He quickly added 1 to 100, 2 to 99, and so on for 50 pairs ... 1,000,000,000.That's all the digits in all the numbers, not all the numbers themselves. -Riddles

Last Answer : The numbers can be grouped by pairs: 999,999,999 and 0; 999,999,998 and 1' 999,999,997 and 2; and so on.... There are half a billion pairs, and the sum of the digits in each pair is 81. The digits in the unpaired number, 1,000,000,000, add to 1. Then: (500,000,000 X 81) + 1= 40,500,000,001.

Description : A computer program selects an integer in the set {k : 1 ≤ k ≤ 10,00,000} at random and prints out the result. This process is repeated 1 million times. What is the probability that the value k = 1 appears in the printout atleast once ? (A) 0.5 (B) 0.704 (C) 0.632121 (D) 0.68

Last Answer : (C) 0.632121

Description : Assuming there are n keys and each keys is in the range [0, m-1]. The run time of bucket sort is (A) O(n) (B) O(n lgn) (C) O(n lgm) (D) O(n+m)

Last Answer : (D) O(n+m)

Description : Let P(m,n) be the statement m divides n where the Universe of discourse for both the variables is the set of positive integers. Determine the truth values of the following propositions. (a) ∃m ∀n P(m,n) (b) ∀n P(1,n) ( ... -False (C) (a)-False; (b)-False; (c)-False (D) (a)-True; (b)-True; (c)-True

Last Answer : Answer: A

Description : I am a three-digit number. All of my digits are prime. One of the numbers is even. Each of my numbers are used only once. The total of my first and last digits equals 10. The total of my first two digits equals 5. -Riddles

Last Answer : This one is fairly easy if you use elimination if you follow all the first 5 steps you get three options: 525, 327, and 723 but if you followed the last step you would reach your answer. The answer was 327.

Description : A) NK Chari Explanation: N.K.Chari, the new Managing Director of State Bank of Mysore, assumed office on May

Last Answer : Prior to his new position, he was the Deputy Managing Director of State Bank of India.

Description : An ideal sort is an in-place-sort whose additional space requirement is ............... (A) O(log2n) (B) O(nlog2n) (C) O(1) (D) O(n)

Last Answer : Answer: C

Description : If n integers taken at random are multiplied together, then the probability that the last digit of the product is 1, 3, 7 or 9 is -Maths 9th

Last Answer : (d) 226 × 52C26 | 104C26Since there are 52 distinct cards in a deck and each distinct card is 2 in number.∴2 decks will also contain only 52 distinct cards, two each.∴ Probability that the player gets all distinct cards = \(rac{^{52}C_{26} imes2^{26}}{^{104}C_{26}}\).

Description : If n and r are non-negative integers and n≥r, then p(n + 1, r) equals to (A) P(n,r)(n+1) / (n+1-r) (B) P(n,r)(n+1) / (n-1+r) (C) p(n,r)(n-1) / (n+1-r) (D) p(n,r)(n+1) / (n+1+r)

Last Answer : (A) P(n,r)(n+1) / (n+1-r)  Explanation: p(n, r) = n!/(n-r)! p( n+1, r) = (n+1)!/(n+1-r)! = (n+1) n! /(n+1-r) (n-r)! = P(n, r)(n+1)/(n+1-r)

Description : A tree with n vertices is called graceful, if its vertices can be labelled with integers 1, 2, ...,n such that the absolute value of the difference of the labels of adjacent vertices are all different. Which of the following trees are ... (B) (b) and (c) (C) (a) and (c) (D) (a), (b) and (c)

Last Answer : Answer: D

Description : I am a two-digit number. All my digits are even. No two digits are the same. None of my digits are prime numbers. I am not a multiple of ten. My tens digit is bigger than my other numbers. ... big the number is) of all the other options with their digits added together. What number am I? -Riddles

Last Answer : If you followed all the steps apart from the last one there will be three options remaining: 64, 84, and 86. You then had to add up the digits, 64=6+4=10, 84=8+4=12, and 86=8+6=14. ... biggest number (12) and put it back as it was before the digits were added together and your answer should be 84.

Description : How many 7-digit numbers can be formed using the digits 1 2 3 4 and 8?

Last Answer : What is the answer ?

Description : How many 3-digit numbers are there in which the product of those 3 digits is 9?

Last Answer : 119, 191, 911, 331, 313, 133

Description : The relation "divides" on a set of positive integers is .................. (A) Symmetric and transitive (B) Anti symmetric and transitive (C) Symmetric only (D) Transitive only

Last Answer : (B) Anti symmetric and transitive Explanation: The ‘divide’ operation is antisymmetric because if a divides b does not necessarily implies that b divides a. If a divides b and b divides c then a divides c. So, it is transitive as well.

Description : Let f and g be the functions from the set of integers to the set integers defined by f(x) = 2x + 3 and g(x) = 3x + 2 Then the composition of f and g and g and f is given as (A) 6x + 7, 6x + 11 (B) 6x + 11, 6x + 7 (C) 5x + 5, 5x + 5 (D) None of the above

Last Answer : (A) 6x + 7, 6x + 11 Explanation: fog(x)=f(g(x))=f(3x+2)=2(3x+2)+3=6x+7 gof(x)=g(f(x))=g(2x+3)=3(2x+3)+2=6x+11

Description : An integer is chosen at random from the first two hundred positive integers. What is the probability that the integer chosen is divisible by 6 or 8 ? -Maths 9th

Last Answer : As there are 200 integers, total number of exhaustive, mutually exclusive and equally likely cases, i.e, n(S) = 200 Let A : Event of integer chosen from 1 to 200 being divisible by 6⇒ n(A) = 33 \(\bigg(rac{200}{6}=33rac{1}{3}\ ... (rac{25}{200}\) - \(rac{8}{200}\) = \(rac{50}{200}\) = \(rac{1}{4}\).

Description : What is the largest of three consecutive odd integers if the product of the first and third integers is 6 more than three times the second integer?

Last Answer : Let the middle one be n, then:(n - 2)(n + 2) = 3n + 6→ n² - 4 = 3n + 6→ n² - 3n - 10 = 0→ (n + 2)(n - 5) = 0→ n = -2 or 5-2 can be discounted as n is odd→ n = 5→ largest of the three odd numbers is 5 + 2 = 7.

Description : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

Description : In the multiplication below each letter represents a different digit and only the digits 1 2 3 4 5 are used. Which of the letters represents 2?

Last Answer : E

Description : How many integers between 1000 and 9999 are even digits?

Last Answer : Need answer

Description : Red-black trees are one of many Search tree schemes that are "balanced” in order to guarantee that basic dynamic-set operations take ............. time in the worst case. (1) O(1) (2) O(log n) (3) O(n) (4) O(n log n)

Last Answer : (2) O(log n) 

Description : Given two sorted list of size 'm' and 'n' respectively. The number of comparison needed in the worst case by the merge sort algorithm will be (A) m x n (B) max (m, n) (C) min (m, n) (D) m + n – 1

Last Answer :  (D) m + n – 1

Description : An I/O device which provides photographic outputs for printing galleys, is the 1) Camera printer 2) Automatic typesetter 3) Radix printer 4) All of these

Last Answer : 4) All of these

Description : A number with both integer and a fractional part has digits raised to both positive and negative powers of 2 in a decimal number system. a) True b) False

Last Answer : Answer: b Explanation: In a decimal number system, a number with both integer and a fractional part has digits raised to both positive and negative powers of 10 and not 2. e.g. 22.34 = 2 * 101 + 2 * 100 + 3 * 10-1 + 4 * 10-2

Description : A structure brings together a group of A) items of the same data type B) related data items and variables C) integers with user defined names D) floating points with user defined names

Last Answer : B) related data items and variables

Description : What does the following declaration mean ? int (*ptr) [10]; (A) ptr is an array of pointers of 10 integers. (B) ptr is a pointer to an array of 10 integers. (C) ptr is an array of 10 integers. (D) none of the above.

Last Answer : (B) ptr is a pointer to an array of 10 integers.

Description : Let A and B be two fuzzy integers defined as: A={(1,0.3), (2,0.6), (3,1), (4,0.7), (5,0.2)} B={(10,0.5), (11,1), (12,0.5)} Using fuzzy arithmetic operation given by (A) {(11,0.8), (13,1), (15,1)} ( ... ,0.2)} (D) {(11,0.3), (12,0.5), (13,0.6), (14,1), (15,0.7), (16,0.5), (17,0.2)}

Last Answer : (D) {(11,0.3), (12,0.5), (13,0.6), (14,1), (15,0.7), (16,0.5), (17,0.2)}

Description : Compute the value of adding the following two fuzzy integers: A = {(0.3,1), (0.6,2), (1,3), (0.7,4), (0.2,5)} B = {(0.5,11), (1,12), (0.5,13)} Where fuzzy addition is defined as μA+B(z) = maxx+y=z (min(μA(x), μB( ... ,18)} (D) {(0.3,12), (0.5,13), (0.6,14), (1,15), (0.7,16), (0.5,17), (0.2,18)}

Last Answer : (D) {(0.3,12), (0.5,13), (0.6,14), (1,15), (0.7,16), (0.5,17), (0.2,18)} 

Description : Which of the following is not the same set of numbers A) counting numbers (B) positive integers (C) whole numbers (D) natural numbers?

Last Answer : C. whole numbers can be negative and don't match the other sets

Description : Consider the following statements : 1. a^n + b^n is divisible by a + b if n = 2k + 1, where k is a positive integer. -Maths 9th

Last Answer : Statement (1) is correct as for k = 1, n = 2 × 1 + 1 = 3. ∴ a3 + b3 = (a + b) (a2 + b2 – ab) which is divisible by (a + b), statement (2) is also correct as for k = 1, n = 2, ∴ a2 – b2 = (a – b) (a + b) which is divisible by (a – b).

Description : Why do you write ‘Integer.parseInt(br.readLine())’?

Last Answer : A: The inputs in a java program comes in the form of String objects which are read using the br.readLine() function. Now if we want the input in integer form, we have to convert it into integer using the parseInt() function of the Integer wrapper class.

Description : If a variable is declared final, it must include ...................... value. A) integer B) no C) initial D) float

Last Answer : C) initial

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( ); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b);

Last Answer : B) public void myMethod(int a, int

Description : Which of the following control expressions are valid for an if statement? A) an integer expression B) a Boolean expression C) either A or B D) Neither A nor B

Last Answer : B) a Boolean expression

Description : If a is an integer variable, a=7/3; will return a value A) 2.5 B) 3 C) 0 D) 2

Last Answer : D) 2

Description : NULL is (A) the same as 0 for integer (B) the same as blank for character (C) the same as 0 for integer and blank for character (D) not a value

Last Answer : (D) not a value

Description : What is the data type of (1)? a) Tuple b) Integer c) List d) Both tuple and integer

Last Answer : b) Integer

Description : Bresenham line drawing algorithm is attractive because it uses (A) Real arithmetic only (B) Integer arithmetic only (C) Floating point arithmetic (D) Real and integer arithmetic

Last Answer : (B) Integer arithmetic only

Description : The correct way to round off a floating number x to an integer value is (A) y = (int)(x+0.5) (B) y = int(x+0.5) (C) y = (int)x+0.5 (D) y = (int)((int)x+0.5)

Last Answer : (A) y = (int)(x+0.5)

Description : Suppose the function y and a fuzzy integer number around -4 for x are given as y=(x-3)2+2 Around -4={(2,0.3), (3,0.6), (4,1), (5,0.6), (6,0.3)} respectively. Then f(Around - 4) is given by: (A) {(2,0.6), (3,0.3), ... 6), (3,1), (6,0.6), (11,0.3)} (D) {(2,0.6), (3,0.3), (6,0.6), (11,0.3)}

Last Answer : (C) {(2,0.6), (3,1), (6,0.6), (11,0.3)}