Give an algorithm for the following problem. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is minimized. You may assume that n is a multiple of 2.

Consider the following algorithm, where the array A is indexed 1 through n:
int add_them ( int n , int A[ ] ) {
index i , j , k ;
j = 0 ;
for ( i = 1 ; i <= n ; i++)
j = j + A[i] ;
k = 1 ;
for ( i = 1 ; i <= n ; i++)
k = k + k ;
return j + k ;
}
(a) If n = 5 and the array A contains 2, 5, 3, 7, and 8, what is returned?
(b) What is the time complexity T(n) of the algorithm?

Consider the following algorithm:
for ( i = 2 ; i <= n ; i++) {
for ( j = 0 ; j <= n) {
cout << i << j ;
j = j + floor(n/4) ;
}
}
(a) What is the output when n = 4
(b) What is the time complexity T(n). You may assume that n is divisible 4.

Consider the following algorithm:
j = 1 ;
while ( j <= n/2) {
i = 1 ;
while ( i <= j ) {
cout << j << i ;
i++;
}
j++;
}
(a) What is the output when n = 6, n = 8, and n = 10?
(b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.

1. Consider the following algorithm:
for ( i = 1 ; i <= 1 . 5 n ; i++)
cout << i ;
for ( i = n ; i >= 1 ; i - - )
cout << i ;
(a) What is the output when n = 2, n = 4, and n = 6?
(b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.

A complete, local search algorithm always finds goal if one exists, an optimal algorithm always finds a global minimum/maximum. State whether True or False.
a) True
b) False

61

What is the consequence between a node and its predecessors while creating Bayesian network?
a) Conditionally dependent
b) Dependent
c) Conditionally independent
d) Both a & b

181

Which is used to compressed gasses to drive (power) the robot ?

80

Which search agent operates by interleaving computation and action?
a) Offline search
b) Online search
c) Breadth-first search
d) Depth-first search

70

As you're starting work on your game, one of your colleagues suggests avoiding pathfinding completely, and just using potential fields for pathfinding and navigation. He suggests that you just overlay a big 2D grid over the world, with each cell indicating the distance to the nearest obstacle. Is his idea feasible? Why or why not? When would it cause problems? Regardless of the answer to that question, what are some of the other ways that such a system could be used?

213

Explain List of artificial intelligence projects?

42

In which of the following agent does the problem generator is present?
a) Learning agent
b) Observing agent
c) Reflex agent
d) None of the mentioned

142

To overcome the need to backtrack in constraint satisfaction problem can be eliminated by
a) Forward Searching
b) Constraint Propagation
c) Backtrack after a forward search
d) Omitting the constraints and focusing only on goals

124

Consider the following algorithm:
j = 1 ;
while ( j <= n/2) {
i = 1 ;
while ( i <= j ) {
cout << j << i ;
i++;
}
j++;
}
(a) What is the output when n = 6, n = 8, and n = 10?
(b) What is the time complexity T(n)? You may assume that the input n is divisible by 2.

57

Like relational databases there does exists fuzzy relational databases.
a) True
b) False

137

What does the Bayesian network provides?
a) Complete description of the domain
b) Partial description of the domain
c) Complete description of the problem
d) None of the mentioned

160

Which search uses only the linear space for searching?
a) Best-first search
b) Recursive best-first search
c) Depth-first search
d) None of the mentioned

57

Where does the Bayes rule can be used?
a) Solving queries
b) Increasing complexity
c) Decreasing complexity
d) Answering probabilistic query

131

What is a shopping bot?

1234

The values of the set membership is represented by
a) Discrete Set
b) Degree of truth
c) Probabilities
d) Both b & c