0% found this document useful (0 votes)
56 views3 pages

Data Struct Viva Cheat Sheet

Data structures are methods for storing and organizing data efficiently, with types including linear and non-linear structures. Linear structures, like queues and stacks, arrange elements sequentially, while non-linear structures, like trees and graphs, organize elements hierarchically. Key concepts include sorting, recursion, and the differences between arrays and linked lists.

Uploaded by

ruidemon21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views3 pages

Data Struct Viva Cheat Sheet

Data structures are methods for storing and organizing data efficiently, with types including linear and non-linear structures. Linear structures, like queues and stacks, arrange elements sequentially, while non-linear structures, like trees and graphs, organize elements hierarchically. Key concepts include sorting, recursion, and the differences between arrays and linked lists.

Uploaded by

ruidemon21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Q1) what is data structure? give its Type.

Data structure is a storage that is used to store and organize data.


It is a way of arranging data on a computer so that it can be accessed and updated
efficiently.
Types of Data Structure :
Linear data structure,
Non-linear data structure

Q2) what you mean by linear and non linear ?

In linear data structures, the elements are arranged in sequence one after the
other.
Since elements are arranged in particular order, they are easy to implement.
Unlike linear data structures, elements in non-linear data structures are not in
any sequence.
Instead they are arranged in a hierarchical manner where one element will be
connected to one or more elements.

q3) queue :-
queue is a linear data structure that stores items in First In First Out (FIFO)
manner.
With a queue the least recently added item is removed first.
A good example of queue is any queue of consumers for a resource where the consumer
that came first is served first.

Types :- Simple Queue, Circular Queue, Priority Queue, Double Ended Queue

q4) Dqueue :-
A double-ended queue, or deque, has the feature of adding and removing elements
from either end.
The Deque module is a part of collections library.
It has the methods for adding and removing elements which can be invoked directly
with arguments

Q4) stack :-
stack is a linear data structure that follows the principle of Last In First Out
(LIFO).
This means the last element inserted inside the stack is removed first.
You can think of the stack data structure as the pile of plates on top of another.

Q5) LIFO:-
(Last in First out Queue)
the element that is entered last will be the first to come out.
An item in a queue is added using the put(item) method.
To remove an item, get() method is used.

Q6) Link list:-


A linked list is a sequence of data elements, which are connected together via
links.
Each data element contains a connection to another data element in form of a
pointer.
Python does not have linked lists in its standard library.

Q7) FIFO :-
(First in First out Queue), the element that goes first will be the first to come
out.
For a LIFO (Last in First out Queue), the element that is entered last will be the
first to come out.

Q8) Differnce between Array and Linked list ?

An array is a collection of elements of a similar data type.


A linked list is a collection of objects known as a node where node consists of two
parts,
i.e., data and address. Array elements store in a contiguous memory location.
Linked list elements can be stored anywhere in the memory or randomly stored.

Q) What is Sorting?
Ans) Arranging the elements in (ascending or descending) some particular order is
called
Sorting.

Q9) what is an array? and its types ?

An Array is a Linear data structure which is a collection of data items


having similar data types stored in contiguous memory locations.
There are three different kinds of arrays: indexed arrays, multidimensional arrays,
and associative arrays.

Q10) what is recursion ?

Recursion is a basic programming technique you can use in Java, in which a method
calls itself to
solve some problem. A method that uses this technique is recursive.

Q11) what is overflow and underflow ?


When new data is to be inserted into the data structure but there is no available
space
i.e. free storage list is empty this situation is called overflow.
When we want to delete data from a data structure that is empty this situation is
called underflow.

Q12) Notations :-
Asymptotic notations are the mathematical notations used to describe the running
time of an
algorithm when the input tends towards a particular value or a limiting value

Q13) Sorting :-
Sorting is a process of ordering or placing a list of elements from a collection
in some kind of order.
It is nothing but storage of data in sorted order. Sorting can be done in ascending
and descending order.
It arranges the data in a sequence which makes searching easier.

Q14) Priority Queue :-


The priority queue in the data structure is an extension of the “normal” queue.
It is an abstract data type that contains a group of items.

Q15) fibonacci series :-


Fibonacci series is a series in which each number is the sum of the preceding two
numbers.
By default, the first two numbers of a Fibonacci series are 0 and 1.

Q16) Push and Pop :-


Push: Adds an item in the stack. If the stack is full, then it is said to be an
Overflow condition.
Pop: Removes an item from the stack. The items are popped in the reversed order in
which they are pushed

Q17) What is Tree ?


Other data structures such as arrays, linked list, stack,
and queue are linear data structures that store data sequentially.
In order to perform any operation in a linear data structure,
the time complexity increases with the increase in the data size.

Q18) what is binary tree?


Binary search tree is a data structure that quickly allows us to maintain a sorted
list of numbers.
It is called a binary tree because each tree node has a maximum of two children.

Q19) What is Graph ?


A Graph in the data structure can be termed as a data structure consisting of data
that is stored among many groups of edges(paths) and vertices (nodes), which are
interconnected.

You might also like