TCS Placement: Sample Questions 351 - 352 of 502

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 351

Edit

Describe in Detail

Essay▾

What is stop-and -wait protocol?

Explanation

  • In Stop and wait protocol, sender sends one frame, waits until it receives confirmation from the receiver (okay to go ahead) , and then sends the next frame.
  • In this method of flow control, the sender sends a single frame to receiver & waits for an acknowledgment.
  • The next frame is sent only when acknowledgment of previous frame is received- process continues as long as the sender has data to send.
  • To end transmission sender transmits end of transmission (EOT) frame.
  • The main advantage of stop & wait protocol is accuracy and order- there is no chance of frame being lost or arriving out of order.
  • The method is however inefficient- transmission process is slow as a single frame travels from source to destination and single acknowledgment travels from destination to source- one by one in serial order. Each frame sent and received uses the entire time needed to traverse the link.
Given the Image is Define the Stop and Wait Protocol

Question 352

Edit

Describe in Detail

Essay▾

What is hash table?

Explanation

  • A hash table (hash map) is a data structure, which implements an associative array abstract data type- mapping keys to values.
  • A hash table uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found.
  • In hashing, large keys are converted into small keys by using hash functions. The values are then stored in a data structure called hash table.
  • For example:
  • To enter a name in to the hash table we found out the hash value by applying a suitable hash function.
  • The hash function maps the name into an integer between zero and k-1 this value is used as an index in the hash table.
Given the Image is Define the Hash Table and Operations
Given the Image is Define the Hash Table Example

Developed by: