Code Monkey home page Code Monkey logo

sr-sunny-raj / hacktoberfest2021-dsa Goto Github PK

View Code? Open in Web Editor NEW
229.0 5.0 1.0K 53.07 MB

NOTE -: For Hacktoberfest2022 please refer this repository https://github.com/SR-Sunny-Raj/Hacktoberfest2022-for-everyone to make your contribution. If You know the implementation of any DSA related topic/problem then you can contribute it in this repo. Raise Genuine PRs only. Your PRs will be accepted, keep patience. Star this Repo. You aren't allowed to Update README.md. Welcoming developers, content writers, and programming enthusiasts.

Home Page: https://sr-sunny-raj.github.io/Hacktoberfest2021-DSA/

License: MIT License

C 8.20% C++ 68.26% Python 9.18% Java 13.26% JavaScript 0.32% HTML 0.14% CSS 0.22% Go 0.02% CMake 0.04% C# 0.36%
hacktoberfest cpp dsa-algorithm java data-structures beginner-friendly python open-source c hacktoberfest-2021

hacktoberfest2021-dsa's Issues

Adding - Insert node at a particular position in a Linked List (CPP)

➕ Adding code sample with proper explanation in detail for better understanding of the problem statement.

▶️ Workflow of the code and the approach used.
▶️ With proper indentation and clean code.
▶️ Added comments, as comments enhance the readability of the program.

I would like to contribute to this issue under hacktoberfest2021.
Pls add suitable hacktoberfest labels.
.
.
Pls assign this issue to me.
Thankyou!!

Complex number multiplication problem (leetcode) .

A complex number can be represented as a string on the form "real+imaginaryi" where:

real is the real part and is an integer in the range [-100, 100].
imaginary is the imaginary part and is an integer in the range [-100, 100].
i2 == -1.
Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplications.

Project Excluded

I just created a PR in this project but on the hacktoberfest dashboard it is showing project excluded.

image

Cycle Detection in Linked List (CPP)

Is your feature request related to a problem? Please describe.
Detect Cycle in Linked List and return start of Cycle if present otherwise return NULL without using extra space.

Language = C++

Please assign this to me
Thank You

Adding Rat-Maze problem with efficient solution.

Story: You have to find a path through which the rat move from the starting position (0,0) to the final position where cheese is (n,n). List the total no of possible paths which the rat can take to reach the cheese.

Input
A file whose first line contains the size of the square maze The next n lines contain n binary values separated by space. 0 denotes an open cell while 1 denotes a blocked cell. You have to find paths which contain only cells which are open, and finally print the total no of such unique paths. Retracing the 1 or more cells back and forth is not considered a new path. The set of all cells covered in a single path should be unique from other paths

Output
The output should be the total no of paths possible on the first line

Question link:- https://www.codechef.com/problems/BPHC03

Nearest smaller no to left

like if we have a array like
arr={2,7,4,8}
we need to find the nearest smaller no for each element in a array.
output:
{-1,2,2,4}

Dijkstras Algorithm for shortest path in undirected graph

Is your feature request related to a problem? Please describe.
Graph section of the course is missing djistras algorithm for finding shortest path in undirected graph

Describe the solution you'd like
It is among the most essential graph algorithms

@SR-Sunny-Raj I would like to be assigned for this issue. Thankyou

Minimum number of jumps to reach end

Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a function to return the minimum number of jumps to reach the end of the array (starting from the first element). If an element is 0, they cannot move through that element. If the end isn’t reachable, return -1.

Examples:

Input: arr[] = {1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9}
Output: 3 (1-> 3 -> 8 -> 9)
Explanation: Jump from 1st element
to 2nd element as there is only 1 step,
now there are three options 5, 8 or 9.
If 8 or 9 is chosen then the end node 9
can be reached. So 3 jumps are made.

Input: arr[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
Output: 10
Explanation: In every step a jump
is needed so the count of jumps is 10.
The first element is 1, so can only go to 3. The second element is 3, so can make at most 3 steps eg to 5 or 8 or 9.

I WILL ADD THIS PROBLEM IN DP SECTION

PLEASE ASSIGN THIS PROBLEM TO ME
THANK YOU

Merge Two BSTs (C++)

I would like to add a C++ code that optimally merges 2 BSTs in LogN Space and Linear time.

Peak Element

I want to contribute to this problem using the Binary search technique.

Missing "Decode String" problem in Stacks.

Is your feature request related to a problem? Please describe.
This problem is to decode a given encoded string. Eg, for s = "3[a]2[bc]", output- "aaabcbc".
Problem Link: https://leetcode.com/problems/decode-string/

Describe the solution you'd like
I would use Stack Data Structure to implement this.

Describe alternatives you've considered
It can also be implemented using DFS.

Additional context
NA

Add Union of two arrays.cpp

I would like to add union of two arrays.cpp solution of Leetcode problem statement.
Please assign me this task.

#602 is my pull request ID.

Excluded Project

On the hacktoberfest's website, the project is shown as excluded project.
Please look into the matter....

Minimum Window Substring

Given two strings s and t , return the minimum window substring of s such that every character in t (including duplicates) is included in the window.

Example: s="adobecodebanc"
t="abc"
Output: "banc"
The minimum length of the the substring of s that includes all the characters of t is "banc"

K-Closest point to origin

In this question we will be given points and we need to find the closest point from origin.
Input:-
points = [[3,3],[5,-1],[-2,4]], k = 2

Output:-
[[3,3],[-2,4]]

Add Flattening a Linked List Problem

Problem Statement:-

Given a Linked List of size N, where every node represents a sub-linked-list and contains two pointers:
(i) a next pointer to the next node,
(ii) a bottom pointer to a linked list where this node is head.
Each of the sub-linked-list is in sorted order.
Flatten the Link List such that all the nodes appear in a single level while maintaining the sorted order. 
**Note**: The flattened list will be printed using the bottom pointer instead of the next pointer.

Possible Solution:-

The idea is to use the Merge() process of merge sort for linked lists. We use merge() to merge lists one by one. We recursively merge() the current list with the already flattened list. The down pointer is used to link nodes of the flattened list.

Sieve of Erathosthenes (in C++)

Through this algorithm, prime numbers upto a given target can be found in O(nlog(log(n)))
Example: n=16
Output: 2 3 5 7 11 13

Defense of a Kingdom SPOJ

Theodore implements a new strategy game “Defense of a Kingdom”. On each level a player defends the Kingdom that is represented by a rectangular grid of cells. The player builds crossbow towers in some cells of the grid. The tower defends all the cells in the same row and the same column. No two towers share a row or a column.

The penalty of the position is the number of cells in the largest undefended rectangle. Help Theodore write a program that calculates the penalty of the given position.

Example
Input:
1
15 8 3
3 8
11 2
8 6

Output:
12

Insertion and search in trie

Is your feature request related to a problem? Please describe.
I want to add insertion and search using trie in trie section

please assign this problem to me.
Thank you

LINKED LIST

i want to add new linked list. kindly give me the permission to push.

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.