truong nguyen


{ City } ha noi
< Country > other
* Profession *
User No # 54805
Total Questions Posted # 0
Total Answers Posted # 8

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 47
Users Marked my Answers as Wrong # 9
Questions / { truong nguyen }
Questions Answers Category Views Company eMail




Answers / { truong nguyen }

Question { Wipro, 15508 }

What happens if an exception is throws from an, object's
constructor and object's destructor?


Answer

1. If exception is thrown in the constructor, the destructor will be not called.
2. If exception is thrown in the destructor of a static object, exception will be catch in the main.

Is This Answer Correct ?    3 Yes 0 No

Question { Infosys, 20978 }

Why is it difficult to store linked list in an array?


Answer

Because size of linked list is usually very large. So it is difficult to store data in a linked list in a continuously memory as an array.

Is This Answer Correct ?    1 Yes 3 No


Question { 6386 }

why we cant create array of refrences


Answer

Because address of all the items in an array is continuous. So each item of it cannot reference to a specified variable.

Is This Answer Correct ?    0 Yes 0 No

Question { CSC, 6979 }

Can we remove an element in a single linked list without
traversing?
Lets suppose the link list is like this
1 2 3 4 5 6

We need to remove 4 from this list (without traversing from
beginning) and the final link list shud be 1 2 3 5 6

only thing we know is the pointer to element "4". How can
we remove "4" and link "3" to "5"?


Answer

Memory address of all elements in a linked list are not
continuous. So if we only know the memory address of the
element "4", we cannot know memory address of element "3"
and "5" without traversing. And we cannot remove it from the
linked list.

Is This Answer Correct ?    1 Yes 4 No

Question { 4770 }

What is the difference in size of this two clasees?
Class A
{
int a;
char c;
float f;
}
Class B
{
float f;
char c;
int a;
}


Answer

1. No difference in size in this case. There will be
difference in size, however, if the class A and B are
defined below:

Class A
{
int a;
double d;
char c;
}
Class B
{
double d;
char c;
int a;
}

Is This Answer Correct ?    3 Yes 0 No

Question { 4919 }

Difference between linked list and array?


Answer

Memory address of items in the array are continues but they
are not continues in the linked list. So you will easily to
access one item in an array, but not for a linked list.
However, you can easily insert or remove one item into/from
a linked list.

Is This Answer Correct ?    8 Yes 1 No

Question { Convergys, 6739 }

difference between structure and union.


Answer

Regarding the struct, each item in the struct is allocated
in a separated memory. And the size of a struct object is
total size of all its items.
But with the union, all its items are in the same memory.
And the size of an union object is size of its item which
has largest size.

Is This Answer Correct ?    24 Yes 0 No

Question { IonIdea, 4851 }

in the following, A D
B G E
C F
Each of the seven digits from 0,1,2,3,4,5,6,7,8,9 is:
a)Represented by a different letter in abov fig:
b)Positioned in the fig abov so tht A*B*C,B*G*E,D*E*F are
equal. wch does g represents?

C


Answer

1. A*B*C=B*G*E=D*E*F => B*G=D*F and A*C=G*E (1.a).
2. From numbers in 0,..9, we found these equalities:
9*2 = 6*3
8*3 = 6*4
8*1 = 4*2
6*2 = 4*3
3. In these equalities, only (9*2 = 6*3 and 8*1 = 4*2)
satisfies (1.a) that only one number (number 2) exists on
both two equalities.
4. G = 2.

Is This Answer Correct ?    7 Yes 1 No