459 views
0 votes
0 votes

Let us consider a data structure named UD. Storage can be made in UD in non-increasing order of address. Each address consists of two bytes (i.e., a word). X is a pointer that points to the most recent element entered in UD. InB stores a byte in UD, InW stores a word. When a word is stored, X value changes by 1. If InB stores in the least significant byte of the storage word, X does not change value, otherwise value of X is changed by 1. Similarly, OutB retrieves a byte from UD. OutW retrieves a word from UD. If OutB retrieves the most significant byte, X is not changed. If OutB retrieves the least significant byte, value of X is changed by 1. OutW changes the value of X by 1. Assume that UD is not empty.

 What is UD ?

(A) Dequeue

(B) Array

(C) Circular Queue

(D) Stack
 

2 Answers

1 votes
1 votes

Option d -stack?

Acc to me ,it should to be a stack as there is 1 pointer which points to the most recent element and at the time of insertion it changes to 1 except when it reaches to top or LSB. 

At the time of deletion X changes to 1

edited by
0 votes
0 votes
I think it can be array because the array can store and retrieve elements in non increasing or decreasing order. Other data structures given will not be able to enter elements serially.

Related questions