Basic CS [TCS Placement]: Sample Questions 189 - 190 of 196

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 189

Edit

Describe in Detail

Essay▾

If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

Explanation

  • A linked list is known as heterogeneous when nodes of linked list can contain different type of information.
  • A void pointer can point to any type of data either in-built data type or user defined structure.
  • We can do this by creating an array or linked list of elements that encode both the data and the type of data.
  • We could use a struct that includes a type indicator and a union of the various types that we want to handle, and the create an array or linked list of that struct:

typedef struct {int type_indi; union {float f; int i; double d; void ⚹ p; char c;} } item;

item array [10] ;

  • For a linked list instead of an array, we would also need to add a item ⚹ next pointer.

Question 190

Basic CS
Edit

Describe in Detail

Essay▾

What is Redundancy?

Explanation

  • Redundancy includes extra information for detecting or correcting errors.
  • A shorter group of bits is appended to the end of each unit
  • Extra redundant bits are discarded as soon as the accuracy of the transmission has been determined.
Given the Image is Define the Redundancy
  • Sender adds the redundant bits and the receiver checks the complete bit stream through the checking function.

Developed by: