/DSA

90 Day Challenge

Primary LanguagePython

DSA

90 Day Challenge

1. What is Data Structure ?

A 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.

2. What is an algorithm?

An algorithm is a step by step method of solving a problem or manipulating data. It defines a set of rules for a computer program to accomplisha task.

            Example:     Input --->   calculation -----> Stop When answer fond.

3. Why are DSA inportant ?

Repeat Defination q1 and q2

4.Type of Data Structures

image

5.Primitive Data Structures?

Primitive data structures allow storing only one value at a particular location. Primitive data structures of any programming language are the data types that are predefined in that programming language.

Screenshot 2023-01-16 225850

6. Types of Algorithms

1. Brute Force Algorithm
2. Recursive Algorithm
3. Randomized Algorithm
4. Sorting Algorithm
5. Searching Algorithm
6. Hashing Algorithm

Day 2

7. Arrays

Arrays are defined as the collection of similar type of data items stored at contiguous memory location. Array is the simplest data structure where each data element can be accessed by using its index number.

image

8. Types of Arrays ?

There are majorly two types of arrays
1. One-Dimensional Arrays: A One-Dimensional Array is the simplest form of an Array in which the elements are stored linearly and can be accessed individually by specifying the index value of each element stored in the array.
2. Multi-Dimensional Arrays: A multi-dimensional array can be termed as an array of arrays that stores homogeneous data in tabular form. Data in multidimensional arrays are stored in row-major order.

Create an Arrays ?

When we create an array , we
> Assign it to a variable
> Define the type of elements that it will store
> Define the size (the max number of elements)

from array import*
arrayName = array (typecode, [Initializers])
Example:

``from array import * myArray = array('i',[1,2,34,55,6,87,]) print(type(myArray)) print(myArray)

Day 3

Recipe for Problem Solving

UNDERSTAND THE PROBLEM
EXPLORE EXAMPLE
BREAK IT DOWN
SOLVE / SIMPLIFY
LOOK BACK REFACTOR