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

» Basic CS » Data Structures

Essay Question▾

Describe in Detail

What is the algorithm used in solving the 8 queens problem?

Explanation

Understanding of backtracking

Understanding of Backtracking

Understanding of backtracking

  • 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 depth-first 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

» Database » MySQL

MCQ▾

Question

Tables derived from the ERD

Choices

Choice (4) Response

a.

May have multi-valued attributes

b.

Are always in 1NF

c.

Can be further demoralised

d.

Are totally normalised

Answer

b.

Explanation

1st Normal From example.

Table shows the Product ID and price

Table shows the Product ID and price

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.

Table shows the Product ID and price

Table shows the Product ID and price

Product ID

Price

1

15

2

22

3

17

4

10

5

25

Table shows the Product ID and color

Table shows the Product ID and color

Product ID

Color

1

Red

1

Green

2

Yellow

3

Green

4

Yellow

4

Blue

5

red