71. Which of the following data structure may give overflow error, even though the current number of element in it is less than its size ?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
72. I have a problem to solve which takes as input a number n. The problem has a property that given the solution for (n-1), I can easily solve the problem for n. Which programming technique will I use to solve such a problem?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
73. Which of the following is true about comments?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
74. A language has 28 different letters in total. Each word in the language is composed of maximum 7 letters. You want to create a data-type to store a word of this language. You decide to store the word as an array of letters. How many bits will you assign to the data-type to be able to store all kinds of words of the language.
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
75. function g(int n)
{
if (n > 0) return 1;
else return -1;
}
function f(int a, int b)
{
if (a > b) return g(a-b); if (a < b) return g(-b+a); return 0;
}
If f(a,b) is called, what is returned?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
76. The average search time of hashing with linear probing will be less if the load factor
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
77. A character in new programming language is stored in 2 bytes. A string is represented as an array of characters. A word is stored as a string. Each byte in the memory has an address. The word "Mahatma Gandhi" is stored in the memory with starting address 456. The letter 'd' will be at which memory address?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
78. Srishti writes a program to find an element in the array A[5] with the following elements in order: 8 30 40 45 70. She runs the program to find a number X. X is found in the first iteration of binary search. What is the value of X?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
79. Vijay wants to print the following pattern on the screen: 1
1 2
1 2 3
He writes the following program:
integer i = 1 // statement 1
while ( i <= 3 )
{
int j // Statement 2
while ( j <= i ) // Statement 3
{
print j
print blank space
j = j + 1 // Statement 4
}
print end-of-line \takes the cursor to the next line i = i + 1
}
Will this program function correctly? If not which one statement will you modify to make the program function correctly?
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital
80. Linked lists are not suitable for
Answer:
Explanation:Here is no explanation for this answer
Workspace
TCS NQT TCS Ninja TCS Digital