T
BAN USER- 0of 0 votes
AnswersWhat is pass by value and pass by reference?
- T in United States
a. Can a structure be passed by value?
b. Can an array be passed by value?| Report Duplicate | Flag | PURGE
Bloomberg LP Intern - 0of 0 votes
AnswersHow will you tell whether a given number is a palindrome?
- T in United States
Edit: The question was for a string actually.| Report Duplicate | Flag | PURGE
Bloomberg LP Intern C - 0of 0 votes
AnswersHow will you reverse a given number? (not using "/", "&" operators)
- T in United States
For eg 756 - > 657| Report Duplicate | Flag | PURGE
Bloomberg LP Intern C
int matrix[row][col], temp[col];
//run it for half the rows, it will take care of odd/even cases
for(r=0;r<row/2;r++)
{
for(c=0;c<(col-1);c++)
{
//copy reverse of last row into an array
temp[c]=matrix[row-r][col-c];
//copy the reverse of rth row into the (row-r)th row
matrix[row-r][col-c]=matrix[r][c];
//copy temp into the rth row from top
matrix[r][c]=temp[c];
}
}
Disadvantage:
- T February 09, 2013Sometimes when using locks (for eg in case of a thread and interrupt handler), interrupts and/or pre-emption is disabled. As a consequence interrupts are ignored/queued and delayed or process can't swap and the higher priority process has to wait. Affects the normal OS operation.
Starvation:
The indefinite waiting by a thread because other threads keeping coming in.
Deadlock:
Number of threads waiting for resources held by other threads.