Monday, May 7, 2007

Campus_7 (FAQ's)

Todays Winners are

1. Animesh from JP Institute , NOIDA
2. Mamta Singhar from IGIT, Delhi


Q1: Suppose a 3-bit sequence number is used in the selective-reject ARQ, what is the maximum number of frames that could be transmitted at a time?

A1: If a 3-bit sequence number is used, then it could distinguish 8 different frames. Since the number of frames that could be transmitted at a time is no greater half the numner of frames that could be distinguished by the sequence number, so at most 4 frames can be transmitted at a time

Q2: Describe Stacks and name a couple of places where stacks are useful.
A2: A Stack is a linear structure in which insertions and deletions are always made at one end, called the top. This updating policy is called last in, first out (LIFO). It is useful when we need to check some syntax errors, such as missing parentheses.

Q3: Describe one simple rehashing policy.
A3: The simplest rehashing policy is linear probing. Suppose a key K hashes to location i. Suppose other key occupies H[i]. The following function is used to generate alternative locations:

rehash(j) = (j + 1) mod h

where j is the location most recently probed. Initially j = i, the hash code for K. Notice that this version of rehash does not depend on K.

Q4: Write the pseudo code for the Depth first Search.
A4:
dfs(G, v) //OUTLINE
Mark v as “discovered”
For each vertex w such that edge vw is in G:
If w is undiscovered:
dfs(G, w); that is, explore vw, visit w, explore from there
as much as possible, and backtrack from w to v.
Otherwise:
“Check” vw without visiting w.
Mark v as “finished”


Q5: What are the advantages and disadvantages of B-star trees over Binary trees?
A5: B-star trees have better data structure and are faster in search than Binary trees, but it’s harder to write codes for B-start trees.

No comments: