3i Infotech Papers: Sample Questions 370  371 of 1245
Examrace Placement Series prepares you for the toughest placement exams to top companies.
Question number: 370
Describe in Detail
What is the algorithm used in solving the 8 queens problem?
Explanation

Backtracking is the type of the algorithm used in solving the 8 Queens problem.

Considers searching every possible combination in order to solve an optimization problem.

Also known as depthfirst search.
Algorithm of backtracking:

Boolean solve (Node n)
{
If n is a leaf node
{
If the leaf is goal node, return true
Else return false
}
Else
{
For each child c of n
{
If solve (c) succeeds, return true
}
Return false
}
}

The algorithm is expressed as a Boolean function.
Question number: 371
Question
Tables derived from the ERD
Choices
Choice (4)  Response  

a.  May have multivalued attributes 

b.  Are always in 1NF 

c.  Can be further demoralised 

d.  Are totally normalised 

Answer
b.Explanation
1^{st} Normal From example.
Product ID  Color  Price 
1  Red, green  15 
2  Yellow  22 
3  Green  17 
4  Yellow, blue  10 
5  red  25 

This table is not in first normal form because the [color] column can contain multiple values

For ex. The first row includes value “red” and “green”.

To bring this table to first normal form, we split the table into two tables.
Product ID  Price 
1  15 
2  22 
3  17 
4  10 
5  25 
Product ID  Color 
1  Red 
1  Green 
2  Yellow 
3  Green 
4  Yellow 
4  Blue 
5  red 