You are on page 1of 1

1. What is a B-tree ? Discuss the insertion in B-tree concept.

2. Compare the mechanism of searching techniques: sequential searching and


binary searching.
3. Discuss the basic strategy of quick short. Give the code for the proced
ure Quick short.
4. Discuss the basic rule of using the recursion technique.
5. What are the different languages suitable for AI implementation?
6. Discuss Fibonacci sequence and infinite recursion with examples.
7. What is the equivalent pointer expression for referring the same elemen
t a[i][j][k][l]
ref: http://www.geekinterview.com/question_details/80710
Sol :Let us first take a simple example of a 2 dimensional array.
a[i][j]. Let the values be
a[0][0] = 1
a[0][1] = 2
a[0][2] = 3
a[1][0] = 4
a[1][1] = 5
a[1][2] = 6
a[2][0] = 7
a[2][1] = 8
a[2][2] = 9
Since 'a' is 2 dimensional
*a would give us '1'.
*(a+1) would give us '4' instead of 2.
The reason is that a is a pointer to a single dimensional array.
So it increments to the next single dimensional array.
*a would be pointing to the values set '1 2 3'
*(a+1) points to '4 5 6'
*(a+2) points to '7 8 9'
From here it is like single dimensional array.
So we have +1 incrementing to the next element.
So value at *(a+2) + 1 i.e. *( *(a+2) + 1) will give us 8 which
is a[2][1]
so *(*(a+i)+j) = a[i][j].
Similar concept can be applied for any dimensional array.
*(*(*(*(a+i) + j) + k) + l) = a[i][j][k][l]
8. Can a stack be described as a pointer? Explain.
Ans. Stack can be described as a pointer as it contains a head pointer
always pointing to the topmost element of the stack. The Pus
h and Pop operations are performed using this pointer.

You might also like