0% found this document useful (0 votes)
35 views4 pages

DSA Unit 1

The document defines key concepts related to data structures, including how data is organized and stored in memory. It describes common data structure operations like insertion, deletion, sorting, and searching. It also classifies data structures as primitive (storing a single data type) or non-primitive (storing multiple types), with linear structures like arrays and linked lists arranged sequentially and non-linear structures like trees and graphs arranged non-sequentially. Specific data structures like stacks, queues, and 1D, 2D, and 3D arrays are also defined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

DSA Unit 1

The document defines key concepts related to data structures, including how data is organized and stored in memory. It describes common data structure operations like insertion, deletion, sorting, and searching. It also classifies data structures as primitive (storing a single data type) or non-primitive (storing multiple types), with linear structures like arrays and linked lists arranged sequentially and non-linear structures like trees and graphs arranged non-sequentially. Specific data structures like stacks, queues, and 1D, 2D, and 3D arrays are also defined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

What is Data Structure?

Data Structure is a way to store and organize data in the main memory. It is technique or method of
study how the data are interrelate to each other logically and mathematically.

Operation of Data Structure?

1. Insertion: Adding new data to the structure is called insertion.


2. Deletion: Removing data from the structure is called deletion.
3. Sorting: Arranging the elements in a specific order is called sorting
4. Search: Finding a specific element within the data structure to determine whether it exists is called
searching.
5. Updating: Modifying or changing the value of existing data within the structure is called updating.

What are the Classification of Data Structure?

Data structure are classified in 2 types:-

1. Primitive DS:-
Primitive data structure is a kind of data structure that stores the data of only one type.
For example:- int, char, float, double etc.

2. Non Primitive DS:- Non-primitive data structure is a type of data structure that can store the data of
more than two type.
They are divide in 2 types:-
1. Linear DS:- The arrangement of data in a sequential manner is known as a linear data
structure.
For example:- Arrays, Linked list, Stacks, and Queues.

2. Non Linear DS:- The arrangement of data in a non sequential manner is known as a non
linear data structure.
For example:- Tree, graph and linked list,

What is 1D , 2D and 3D array:-

1. One-Dimensional Array: An Array with only one row of data elements is known as a One-
Dimensional Array. It is stored in ascending storage location.
2. Two-Dimensional Array: An Array consisting of multiple rows and columns of data elements is called
a Two-Dimensional Array. It is also known as a Matrix.
3. Three-Dimensional Array: An array consisting a 2d array is called 3D array.

What is stack and queue?

1. Stack:-

A Stack is a Linear Data Structure that follows the LIFO (Last In, First Out) principle states that the
insertion and deletion from one end of the Stack.

The primary operations In the Stack are as follows:


 Push: To insert a new element in the Stack is called Push Operation.
 Pop: To remove or delete elements from the Stack is calked Pop Operation.

2. Queue:-

The Queue is also a Linear Data Structure that follows the FIFO (First In, First Out) principle states that
the insertion of an element in a Queue is done at one end, and the removal is done at another or
opposite end.

The following are the primary operations of the Queue:

 Enqueue(Rear): The insertion or Addition of some data elements to the Queue is called
Enqueue. The element insertion is always done with the help of the rear pointer.
 Dequeue(Front): Deleting or removing data elements from the Queue is termed Dequeue. The
deletion of the element is always done with the help of the front pointer.

What are the Difference Between Stack and Queue?

What is Top Pointer?

The top pointer is used in a stack to indicate the top element. It helps in adding new elements to the top
and removing elements from the top.
Define Bubble Sort, Insertion Sort and Selection Sort?

 Bubble Sort: Bubble sort is like repeatedly swapping adjacent elements if they are in the wrong
order.
 Insertion Sort: Insertion sort is like building a sorted list one item at a time by shifting larger
elements to the right.
 Selection Sort: Selection sort is like finding the smallest element and swapping it with the first
unsorted element.

What is Linear and Binary Searching?

 Binary Searching:-
Binary search is a technique used to find the given elements from the sorted array by continuously
halving the array and then searching specified elements from a half array.
It works only the sorted data structures.

 Linear Search:-
A linear search is also known as a sequential search that simply scans each element at a time.
It works on the both sorted and unsorted data structures.

Difference Between Static and Dynamic Memory Allocation?

Static Memory Allocation Dynamic Memory Allocation

When the allocation of memory performs at the When the memory allocation is done at the
compile time, then it is known as static memory. execution or run time, then it is called dynamic
memory allocation.

The memory is allocated at the compile time. The memory is allocated at the runtime

It is fast. It is slow.

This memory allocation is simple. This memory allocation is complicated

In static memory allocation, while executing a In dynamic memory allocation, while executing a
program, the memory cannot be changed. program, the memory can be changed.

What is Algorithm?

The step by step Declaration of any Program is called Algorithm. It is the sequence Wise Declaration of
any program.
Difference between Linear and Non Linear Data Structure?

Linear Data Structure Non Linear Data Structure

Those data structures are arranged in Those data structures are not arranged
sequential order is called linear data in sequential order is called non linear
structure. data structure.

It is Single Level. It is Multi Level.

It is easier to implement. It is difficult to implement.

Memory Utilization in insufficient. Memory Utilization is sufficient.

Example., Array, stack and queue. Example., Tree and Graph

You might also like