20 Data Structure Question-Answer free

DS Image Q/A

1. Question: What is Data in Data Structure?

Data can be defined as a representation of facts, concepts or instructions in a formalized manner suitable for communication, interpretation or processing by human or electric machine. Data is represented with the help of characters like Alphabets (A-Z, a-z), digits (0-9) or special characters (+, -, /, *, <, >, = etc.)

2. Question: What is Data in Data Item(Field) Structure?

A set of characters which are used together to represent a specific data element e.g. name of a student in a class is represented by the data item, say, NAME.

The data items can be classified into two types depending upon the usage.

  1. Elementary Data Item:- These data items can not be further sub-divided. For example SID.
  2. Group Data Items: – These data items can be further sub-divided into elementary data items. For example Date. Date may be divided into days, months and years.
Data Structure E-Books

3. Question: What is Data Structure?

A data structure is a class of data that can be characterized by its organization and the operations that are defined on it. Hence,

Data Structure = Organized data + Allowed Operations

In other words, the organized collection of data is called data structures.

4. Question: Difference Between Primitive and Non-Primitive?

The data structure that are atomic (indivisible) are called primitive. Example are integer, real, Boolean and characters.

The Data structure that are not atomic are called non primitive or composite. Example are records, array and string.

5. Question: Difference Between Linear and Non-Linear?

In a linear data structure, the data items are arranged in a linear sequence. Example is array.

In a non-linear data structure, the data items are not in sequence. Example is tree.

6. Question: Difference Between Homogenous and Non-Homogenous?

In homogenous structures, all the elements are of same type. Example is arrays

In non-homogenous structures, the elements may or may not be of the same type. Example is Records.

7. Question: Difference Between Static and Dynamic ?

Static structures are ones whose sizes and structures, associated memory location are fixed at compile time.

Dynamic structures are ones which expand or shrink as required during the program execution and there associate memory location change.

8. Question: What is Arrays in Data Structure?

An array is a finite, ordered set of homogenous elements. By homogenous, we mean that all the elements of the set are of same type. By ordered set, we mean that each element of the set has a unique position and can be accessed by referring to its position within the set.

9. Question: What is Records in Data Structure?

In the array all elements must be of the same type. In the case of records, the data type of the elements of the record need not be same. Thus, a record is a collection of data items, usually of different of different data types, which are logically combined into a single unit. An entry in a telephone directory is a simple example of record. It consists of the name, address and telephone number of an individual. A file is collection of similar records. Hence the record is composed of data items that may be of different data type. The data items of a record are called fields.

10. Question: Memory Management Techniques?

A memory management technique determine how and when memory should be allocated to the variables declared in the program. There are two techniques for memory management.

  1. Static Memory Allocation Technique: Using this technique memory is reserved by the compiler for variables declared in the program. This technique is used for the Programming Language FORTAN.
  2. Dynamic Memory Allocation Technique: Using this technique, memory is allocated/deallocated for variables during program executions. This techniques is used for the Programming Language PASCAL. The data type pointer is used in variables that need dynamic memory allocation.

11. Question: How many Types of Array Present in DS?

There are two types of Array,

  1. Linear Array or One-Dimensional Array
  2. Multi-Dimensional Array

12. Question: Explain One-Dimensional Array ?

One-Dimensional Array is a linear data structures in which the position of an element within the array can be given by jus one index or subscript. For example, if we have 6 students with roll numbers 1,2,…,6 and their marks are 15, 25, 20, 30, 37, 28 respectively.

13. Question: What Operations can do on One-Dimensional Array ?

Operations on One-Dimensional Arrays are: –

  1. Traversing
  2. Insertion
  3. Deletion
  4. Sorting
  5. Searching
  6. Merging

14. Question: Explain Inserting an element into a Linear Array.

Inserting means adding a new element to the array. A new element can be inserted in an array if the array does have enough space for that element. If we want to add the element at the end of the array, then there is no problem. Just insert the element at the end. If we want to add the element in the middle of the array, then we have to move each element from the specified location by one location downward to accommodate the new element and keep the order of the other elements.

15. Question: Explain Deleting an element from a Linear Array.

Deleting refers to the operations of removing one of the elements from the linear array. Deleting an element at the end of an array present no difficulties, but deleting an element somewhere in the middle of the array would require that each subsequent element be moved n location upward in order to fill up the array.

16. Question: What is Two-Dimensional Array?

An array in which two subscripts are required to identify the position of an element is called a two dimensional array or a rectangular array or a matrix. The first subscript identifier is the row number and the second subscript identifier is the column number.

17. Question: What is Three-Dimensional Array?

An array in which there subscripts are required to identify the position of a element is called a three dimensional array. In general, a three dimensional array A can be written as,

A [LB1 : UB1, LB2, : UB2, : LB3, : UB3} 

18. Question: Limitations of an Array?

  1. Size of array is fixed. if we are not sure of the size requirement, maximum size arrays are declared which may waste space. If more space is required at run time, it is not possible to extend arrays.
  2. All the elements in an array must be of the same data type.
  3. Insertion and deletion of elements in array requires shifting of elements which is time consuming.

19. Question: What is Sparse Array?

An array is called sparse array if it has a relatively number of zero elements. – The natural method of representing arrays in memory may not be suitable for sparse arrays. That is, one may save space by storing only those entries which may be non zero.

20. Question: Raw Major Storage Method in Data Structure?

Using this approach, a two-dimensional array is stored with all the elements of first-row in sequence followed by elements of second row in sequence and so on. For example, suppose we have a two-dimensional array say A[1 :3, 1 : 4]. Assume each element required one memory location for its storage.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top