Data Structure Questions and Answers-Parallel Array

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Data Structure Questions and Answers-Parallel Array

Question 1
What are parallel arrays?
A
Arrays of the same size
B
Arrays allocated one after the other
C
Arrays of the same number of elements
D
Arrays allocated dynamically
Data interpretation (DI) Questions answers
Question 1 Explanation: 
Different arrays can be of different data types but should contain same number of elements. Elements at corresponding index belong to a record.

Question 2
Which of the following can be called a parallel array implementation?
A

 firstName = ['Joe', 'Bob', 'Frank', 'Hans'] lastName = ['Smith', 'Seger', 'Sinatra', 'Schultze'] heightInCM = [169, 158, 201, 199] for i in xrange
 firstName = ['Joe', 'Bob', 'Frank', 'Hans'] lastName = ['Smith', 'Seger'] heightInCM = [169, 158] for i in xrange(len(firstName)): print 
C

 firstName = ['Joe', 'Bob'] lastName = ['Smith', 'Seger', 'Sinatra', 'Schultze'] heightInCM = [169, 158] for i in xrange(len(firstName)):
D
None of the mentioned
Current affairs Questions answers
Question 2 Explanation: 
All the arrays must have equal length, that is, contain same number of elements.

Question 3
What are the advantages of parallel arrays over the traditional arrays?
A
When a language does not support records, parallel arrays can be used
B
Increased locality of reference
C
Ideal cache behavior
D
All of the mentioned
ICT Questions answers
Question 3 Explanation: 
In a record, if a field contains only 1 bit, extra space is needed to pad the bits, instead you can use parallel arrays to save space. Sequential access improves locality of reference and cache behavior.

Question 4
What are some of the disadvantages of parallel arrays?
A
Poor locality of reference for non-sequential access
B
Very little direct language support
C
Expensive to shrink or grow
D
All of the mentioned
Bank exam Questions answers
Question 4 Explanation: 
They share the drawbacks of arrays.

Question 5
What is a sorted array?
A
Arrays sorted in numerical order
B
Arrays sorted in alphabetical order
C
Elements of the array are placed at equally spaced addresses in the memory
D
All of the mentioned
Data interpretation (DI) Questions answers
Question 5 Explanation: 
The array can be sorted in any way, numerical, alphabetical or any other way but the elements are placed at equally spaced addresses.

There are 5 questions to complete.

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<