minhajul-im / DSA-Problem-Solving

We will explore Data Structure & algorithms. Some Leetcode problems will be solved. ##Happy DSA

Home Page:https://leetcode.com/problemset/all/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSA (Data Structure & Algorithms)

We will explore data structure & algorithm.

What is "DSA"?

"DSA" means Data Structure & Algorithm. Data Structure is the way to store & organize data. Algorithm means steps taken to make a decision.

Why need data structure and algorithm? We need to provide an efficient way to find and solve a problem.

Data Structure: The contacts list in your phone is a data structure that organizes your contacts in a way that makes them easy to find and use. This list might be organized alphabetically, by first name or last name, or by other criteria, making it easy for you to find and contact the person you need.

Algorithm: For example, when you search for a contact by name, your phone's software likely uses an algorithm to search through the contacts list and find the contact you're looking for. Similarly, when you add or delete a contact from the list, your phone's software may use algorithms to update the list and ensure that it remains organized and easily searchable. So while the primary function of the Contacts list on your phone is to store and organize data, there is some algorithmic processing involved in managing and manipulating that data as well.

What is Data Structure?
A data structure is a technique of storing and organizing the data in such a way that the data can be utilized in an efficient manner.

A data structure is classified into two categories:-

  1. Linear data structure
  2. Non-linear data structure
What is Linear data structure?
A linear data structure is a structure in which the elements are stored sequentially, and the elements are connected to the previous and the next element. As the elements are stored sequentially, they can be traversed or accessed in a single run. The implementation of linear data structures is easier as the elements are sequentially organized in memory. The data elements in an array are traversed one after another and can access only one element at a time.

The types of linear data structures are Array, Queue, Stack, Linked List......

  1. Array:- A collection of elements of similar data types in contiguous memory locations.
  2. Linked Lists:- A collection of elements, each of which contains a reference to the next element in the list.
  3. Stack:- Stack is linear data structure that uses the LIFO (Last In-First Out).
  4. Queue:- Queue is a data structure that uses the FIFO rule (First In-First Out).
What is a Non-linear data structure?

A non-linear data structure is also another type of data structure in which the data elements are not arranged in a contiguous manner. As the arrangement is non-sequential, so the data elements cannot be traversed or accessed in a single run. In the case of linear data structure, element is connected to two elements (previous and the next element), whereas, in the non-linear data structure, an element can be connected to more than two elements.

Trees and Graphs are the types of non-linear data structure.

  1. Tree:- A tree is a non-linear data structure that is used to represent a hierarchical structure. It consists of nodes connected by edges, where each node has a single parent, except for the root node which has no parent.
  2. Graph:- A graph is a non-linear data structure that is used to represent a collection of vertices (nodes) and edges that connect them. Unlike a tree, a graph can have multiple edges connecting the same pair of vertices.

About

We will explore Data Structure & algorithms. Some Leetcode problems will be solved. ##Happy DSA

https://leetcode.com/problemset/all/


Languages

Language:JavaScript 100.0%