Question:medium

The following data fragment occurs in the middle of the data stream for which the byte stuffing algorithm is used: A B ESC C ESC FLAG ESC FLAG D. What is the output after stuffing?

Show Hint

Byte stuffing is used to ensure that control characters like FLAG and ESC within data do not conflict with actual control sequences. It adds an extra ESC character before these special bytes.
Updated On: Feb 11, 2026
  • A B ESC ESC C ESC ESC FLAG ESC ESC FLAG D
  • A B ESC C ESC ESC FLAG ESC FLAG ESC D
  • A B ESC ESC C ESC ESC FLAG ESC FLAG D
  • A B ESC ESC C ESC FLAG ESC ESC FLAG D
Show Solution

The Correct Option is A

Solution and Explanation

Byte stuffing inserts an ESC byte before each occurrence of a FLAG or ESC byte to distinguish them from control characters. Final Output After Stuffing: A B ESC ESC C ESC ESC FLAG ESC ESC FLAG D.
Was this answer helpful?
0