Friday, 11 January 2013
Floating point representation
Saturday, 15 December 2012
List four significant differences between a file-processing system and a DBMS.
- Both systems contain a collection of data and a set of programs which access that data. A database management system coordinates both the physical and the logical access to the data, whereas a file-processing system coordinates only the physical
Monday, 5 March 2012
How do you list files in a directory?
First of all, the include file dos.h defines a structure named find_t, which represents the structure of the DOS file entry block. This
Friday, 24 February 2012
How can you restore a redirected standard stream?
The dup() function duplicates a file handle. You can use the dup() function to save the file handle corresponding to the stdout standard
Sunday, 19 February 2012
If errno contains a nonzero number, is there an error?
Usually, the standard C library function you are calling returns with a return code which denotes that an error has occurred and that the
Sunday, 5 February 2012
Which config file has all the supported channels/protocol ?
Note :- Interviewer will not ask you to name all channels and
Friday, 3 February 2012
What is the easiest searching method to use?
Following is the prototype for bsearch():
void *bsearch(const void *key, const void *buf, size_t num, size_t size, int (*comp)(const void *, const void *));
The bsearch() function performs a binary search on an array of sorted data elements. A binary search is another “divide and conquer” algorithm. The key is compared with the middle element of
Saturday, 28 January 2012
How can I sort things that are too large to bring into memory?
Monday, 23 January 2012
The Radix Sort
Two functions perform the radix sort. The function radixSort() performs one pass through the data, performing a partial sort. Line
Saturday, 21 January 2012
Sun Certified Java Programmer (SCJP) Questions
Which of the following statements is not true about threads ?
Choices:
- A. If the start() method is invoked twice on the same Thread object, an exception is thrown at runtime.
- B. The order in which threads were started might differ from the order in which they actually run.
- C. If the run() method is directly invoked on a Thread object, an
Tuesday, 17 January 2012
The Merge Sort
Below example shows an implementation of the merge sort algorithm. To make things more interesting, the strings will be put into a linked list structure rather than an array. In fact, the algorithm works better on data that is organized as lists, because elements in an array cannot be merged in place (some extra storage is required).
There are four functions that together implement merge sort. The function split() takes a list of strings and turns it into a list of lists of
Sunday, 8 January 2012
What is the quickest sorting method to use?
There are three sorting methods in this author’s “toolbox” that are all very fast and that are useful in different situations. Those methods are quick sort, merge sort, and radix sort.
The Quick Sort
The quick sort algorithm is of the “divide and conquer” type. That means it works by reducing a sorting problem into several easier sorting problems and solving each of them. A “dividing” value is chosen from the input data, and the data is partitioned into three sets: elements that belong before the dividing value, the value itself, and elements that come after the dividing value. The partitioning is
Friday, 18 November 2011
Predict the output or error(s) for the following:
{
int a, *pa, &ra;
pa = &a;
ra = a;
cout <<"a="<<a <<"*pa="<<*pa <<"ra"<<ra ;
}
Answer :
Compiler Error: 'ra',reference must be initialized
Explanation :
Monday, 14 November 2011
How Gateway is different from Routers?
A router is a device in computer networking that forwards data packets to their destinations, based on their addresses.
What is passive topology?
Predict the output or error(s) for the following:
{
public:
virtual void baseFun(){ cout<<"from base"<<endl;}
};
class deri:public base
{
public:
void baseFun(){ cout<< "from derived"<<endl;}
};
void SomeFunc(base *baseObj)
{
baseObj->baseFun();
}
int main()
{
base baseObject;
SomeFunc(&baseObject);
deri deriObject;
SomeFunc(&deriObject);
}
Answer:
from base
from derived
Explanation:
Predict the output or error(s) for the following:
{
public:
void baseFun(){ cout<<"from base"<<endl;}
};
class deri:public base
{
public:
void baseFun(){ cout<< "from derived"<<endl;}
};
void SomeFunc(base *baseObj)
{
baseObj->baseFun();
}
int main()
{
base baseObject;
SomeFunc(&baseObject);
deri deriObject;
SomeFunc(&deriObject);
}
Answer:
from base
from base
Explanation:
Friday, 11 November 2011
Predict the output or error(s) for the following:
main()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
}
Answer:
SomeGarbageValue---1
Explanation:
Tuesday, 8 November 2011
Can a variable be both const and volatile?
When should the volatile modifier be used?
Most computers have a set of registers that can be accessed faster than the computer’s main memory. A good compiler will perform a