You are on page 1of 3

Surprise Test Solutions

1. If the number of records to be sorted is small, then ...... sorting

can be efficient :

Solution : Selection

2. List the area of applications of Data Structure.

Solution :

A data structure is a specific way of arranging data in a

computer to use it effectively.

Application of Arrays - Arrays are the data structures that store

elements of the same data type. A basic application of Arrays

can be storing of data in tabular format.

Application of Linked Lists - A linked list is a sequencial data

structure, which connects items/elements, called nodes, through

links.

Application of Stack - A stack is a data structure that uses LIFO

order i.e. Last In First Out.

Application of Queue - A queue is a data structure that uses

FIFO order i.e. First In First Out.


Application of Graph - Graph is a data structure where data is

stored in a collection/body of interconnected vertices i.e. nodes

and edges i.e. paths.

Application of Tree - Trees are hierarchical structures that have

a single root node.

Application of Hash Tables - Hash Tables store data in

key-value pairs. It only stores data that has a key associated

with it. Insertion and Searching operations are easily

manageable using Hash Tables.

Application of Heap - A Heap is a unusual case of a binary tree

where the parent nodes are compared to their children with their

values and are organized/arranged accordingly.

Application of Matrix - Matrix is an ordered collection of

columns and rows of items/elements.

3. Differentiate linear and non-linear data structure?

Solution :

Linear Data Structure:

Data structure , where data elements are arranged sequentially

or linearly where the elements are attached to their previous and

next adjacent in what is called a linear data structure. In linear

data structure, a single level is involved. Therefore, we can


traverse all the elements in a single run only. Linear data

structures are easy to implement because computer memory is

arranged in a linear way. Its examples are array, stack, queue,

linked list, etc.

Non-linear Data Structure:

Data structures , where data elements are not arranged

sequentially or linearly are called non-linear data structures. In a

non-linear data structure, a single level is not involved.

Therefore, we can’t traverse all the elements in a single run only.

Non-linear data structures are not easy to implement in

comparison to the linear data structure. It utilizes computer

memory efficiently in comparison to a linear data structure. Its

examples are trees and graphs.

You might also like