Git Product home page Git Product logo

dsa's Introduction

hacktoberfest

Hi HACKTOBERFEST 2022 IS HERE ‼️‼️‼️

🎭 What is Hacktoberfest ?

♦️ Hacktoberfest is a month-long challenge. It happens every year in the month of October. Hacktoberfest is open to everyone and it marks the celebration of Open Source. It's the biggest Open Source event that encourages newbies to participate in Open Source and create their 1st meaningful PR.

🏆 🏆 Rewards : 🏆🏆

You get some awesome goodies which include A limited-edition T-shirt for FREE! and some stickers.

🤔🤔How can you Join ❔❔

Navigate to the link below 👇 👇 and follow the instructions ✔️ ✔️

https://hacktoberfest.digitalocean.com/register

Excited ⁉️ 🤩 🤩 🤩

To add your contributions towards opensource community and grab the oppurtunity:smiley: :smiley::smiley:

Then lets start with this repository.

😎 😎 DSA 😎 😎 (Collection of DSA problems and solutions 📔 📔)

Head down ⬇️ ⬇️ ⬇️ to see how to get started with the repo and follow the guidelines 🎯 🎯 🎯


🏷️ Use proper folders and subfolders to define catagory and put program file(c/c++/java/python/js) and explanation in a readme file

Example : Array/Sorting&Searching/bubblesort/bubblesort.c

Matrix/Matrix Multiplication/Matrix_multiplication.c (adding further documentation is reccomended)

⚠️Rules ❕ ❕ 😼 😼 😼:

✅ Pull requests can be submitted to any opted-in repository on GitHub or GitLab.

✅ The pull request must contain commits you made yourself.

✅ If a maintainer reports your pull request as 'spam' or 'invalid', it will not be counted toward your participation in Hacktoberfest.

✅ If a maintainer reports behaviour that’s not in line with the project’s code of conduct, you will be ineligible to participate.

✅ To get a shirt, you must make four approved pull requests (PRs) on opted-in projects between October 1-31 in any time zone. This year, the first 55,000 participants can earn a T-shirt.

⚠️What not to do ❗ ❗ 😤 😤

❌ PRs that are automated (e.g. scripted opening PRs to remove whitespace/optimize images)

❌ PRs that are disruptive (e.g. taking someone else’s branch/commits and making a PR)

❌ PRs that are regarded by a project maintainer as a hindrance vs. helping

❌ Something that’s clearly an attempt to simply +1 your PR count for October

Steps to setup this Repository Locally 🧐 🧐🧐


1️⃣ Fork this repository to your account. 😳 😳


PicsArt_10-04-08 04 45


2️⃣ Go to Git Bash and Clone the forked repository ⌨️ ⌨️ :


   $ git clone https://github.com/your_username/make-pull-request

3️⃣ Add a remote (upstream) to original project repository:

$ cd <cloned-folder> $ git remote add upstream https://github.com/arnab2001/DSA.git


4️⃣ Now synchronize your forked repo:

It will help you to keep your forked repo updated with the original repo

$ git checkout main

$ git fetch upstream

$ git merge upstream/main

$ git push origin main


5️⃣Now create a new branch 🧵:

$ git checkout -b <feature-branch>


6️⃣Open the folder in your favourite code editor and add your changes or modifications.


Creating a PR 😱 😱 😱 😱 :

🔺 After making changes or modification on to your code locally, you need to add these files to the staging area.

  $ git add --all

🔺 Once files added, you need to commit the changes to with an appropriate commit message.

  $ git commit -m "<your-message>"

🔺 After commiting the changes, you need to push the changes

   $ git push origin <your-created-branch-name>

🔺 Once you push the changes to your repository, the Compare & pull request button will appear in GitHub.

🔺 Click it and you'll be taken to this screen

🔺 Type a proper description and give the PR an appropriate title. Finally, Open a pull request by clicking the Create pull request button.

That's it. You have opened a PR. Wait for it to get merged. 🥳 🥳 🥳

🎊 🎊 🎆 🎆 Thanks for your Amazing Contribution!! 💥 💥 💥 💘 💘

GIF

📭 📭 You can connect for any query (or can also ask by raising issue)❕ ❕ ❕

dsa's People

Contributors

abhrajit117 avatar amitbanerjee1999 avatar amn2 avatar ananyadas162 avatar archismansaha avatar arifmamon avatar arnab2001 avatar arpitagupta4086 avatar asherthomasbabu avatar ashishkumar47 avatar bishnudev1 avatar geeky-sam01 avatar himanshusingh02 avatar irshit033 avatar khushisahoo avatar kishanmodi avatar kritika6100 avatar lord-haji avatar manoninfinity avatar manonvarma avatar priyanka001tech avatar raunak-pandey avatar sarveshmaurya306 avatar shoebham avatar shreyammaity avatar suprava1919 avatar tamalbag117 avatar umak1106 avatar vaibhav2801 avatar yadavishan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dsa's Issues

Partition Problem (CPP)

Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is the same.

EXAMPLE:
A[ ]= {1, 5, 11, 5}
Output: true (1)
The array can be partitioned as {1, 5, 5} and {11}

A[ ] = {1, 5, 3}
Output: false (0)
The array cannot be partitioned into equal sum sets.

// I wanna contribute this to DP folder , Please assign this to me

Tree Traversal

Inorder Preorder Postorder in cpp. Please assign this to me.

Longest Common Substring (CPP)

Given two strings ‘X’ and ‘Y’, find the length of the longest common substring.

Input : X = “zxabcdezy”, y = “yzabcdezx”
Output : 6
Explanation:
The longest common substring is “abcdez” and is of length 6.

// I wanna contribute this to DP folder , Please assign this to me

longest repeating subsequence

( DP Problem)
Given a string, find the length of the longest repeating subsequence such that the two subsequences don't have same string character at the same position, i.e., any i'th character in the two subsequences shouldn't have the same index in the original string.

Example 1:

Input: str = "axxxy"
Output: 2
Explanation: The longest repeating subsequenece
is "xx".

shortest-common-supersequence

(DP Problem Using C++)

Given two strings X and Y of lengths m and n respectively, find the length of the smallest string which has both, X and Y as its sub-sequences.
Note: X and Y can have both uppercase and lowercase letters.

Example 1

Input:
X = abcd, Y = xycd
Output: 6
Explanation: Shortest Common Supersequence
would be abxycd which is of length 6 and
has both the strings as its subsequences.

Minimum Sum Partition (CPP)

Given an integer array A of size N, the task is to divide it into two sets S1 and S2 such that the absolute difference between their sums is minimum and find the minimum difference

EXAMPLE:
Input: N = 4, A[ ] = {1, 6, 11, 5}
Output: 1
Explanation:
Subset1 = {1, 5, 6}, sum of Subset1 = 12
Subset2 = {11}, sum of Subset2 = 11

// I wanna contribute this to DP folder , Please assign this to me

Bitmasks on Array of string

Finding Number of pairs of strings in an array of strings so that on joining them the resulting string have all vowels

Pigeonhole Sort

I would like to contribute Pigeonhole Sort in JAVA under the Sorting section.

Minimum cost for climbing stairs

Using Dynamic programming.
Given an integer array C where C[i] is the cost of ith step on a staircase. Once we pay the cost, we can either climb one or two steps.
we can either start from the step with index 0, or the step with index 1.

The output will be to return the minimum cost to reach the top of the floor.

Rotate matrix by 90 degrees clockwise

LC. 48. Rotate Image
You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix and do the rotation.

Print Shortest Common Supersequence (CPP)

(DP Problem Using C++)

Given two strings X and Y of lengths m and n respectively, PRINT smallest string which has both, X and Y as its sub-sequences.
Example 1
Input:
X = abcd, Y = xycd
Output: abxycd
Explanation: Shortest Common Supersequence
would be abxycd which is of length 6 and
has both the strings as its subsequences.

// I wanna contribute this to DP folder , Please assign this to me

Coin change Dynamic programming problem

Given a value N, if we want to make change for N cents, and we have a supply of each of C = { C1, C2, .. , Cm} valued coins, how many ways can we make the change if the order of coins doesn’t matter.

Minimum number of jumps to reach end of the array

LC. 45. Jump game II
Given an array of non-negative integers nums, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at that position.

Your goal is to reach the last index in the minimum number of jumps.

You can assume that you can always reach the last index.

Target Sum Subsets

You are given a number n, representing the count of elements and a given target value as input.
You are required to calculate and print true or false, if there is a subset the elements of which add up to given target or not.

Addition of the concept of Disjoint set Union.

Addition of DSU concept.
Often it is also called Union Find because of its two main operations.
I want to add the implementation details. Also,
I will add a question that involves this concept.

Please accept my improvement and assign me this issue. @arnab2001

Pascal's Triangle II

Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle.

In Pascal's triangle, each number is the sum of the two numbers directly above it as shown:

PascalTriangleAnimated2

Unbounded Knapsack using C++

(DP Problem)
Knapsack with Duplicate Items :
Given a set of N items, each with a weight and a value, and a weight limit W. Find the maximum value of a collection containing any of the N items any number of times so that the total weight is less than or equal to W.

Please assign me.

kth largest element in an array

Given an integer array nums and an integer k, return the kth largest element in the array.

Note that it is the kth largest element in the sorted order, not the kth distinct element.

example: Input: nums = [3,2,1,5,6,4], k = 2
Output: 5

i want to add solution of this problem covering all possible approaches (from sorting to quick select)

minimum-number-of-deletions-and-insertion

( DP Problem)

Given two strings str1 and str2. The task is to remove or insert the minimum number of characters from/in str1 so as to transform it into str2. It could be possible that the same character needs to be removed/deleted from one point of str1 and inserted to some another point.

Example 1:

Input: str1 = "heap", str2 = "pea"
Output: 3
Explanation: 2 deletions and 1 insertion
p and h deleted from heap. Then, p is
inserted at the beginning One thing to
note, though p was required yet it was
removed/deleted first from its position
and then it is inserted to some other
position. Thus, p contributes one to the
deletion_count and one to the
insertion_count.

Dutch National Flag Algorithm

LC. 75. Sort Colors
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.

You must solve this problem without using the library's sort function.

Largest Arithmetic Subarray

A has an array of N non-negative integers. A wants to calculate maximum length of contiguous arithmetic subarray.

Arithmetic Subarray is an array that contains at least two integers and the difference between consecutive integers are equal. For example [9,10] , [3,3,3] and [9,7,5,3] arithmetic arrays.

Input: No. of test cases T
integer no N
array A[]

Print Longest Common Subsequence (CPP)

(DP Problem Using C++)

Given two strings X and Y of lengths m and n respectively, PRINT LCS of strings X and Y
Example 1
Input:
X = aggtab, Y = gxtxayb
Output: gtab
Explanation: Longest Common Subsequence
would be gtab which is of length 4

// I wanna contribute this to DP folder , Please assign this to me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.