Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add algorithms in different languages #20

Open
srbcheema1 opened this issue Sep 30, 2017 · 21 comments · May be fixed by #356
Open

Add algorithms in different languages #20

srbcheema1 opened this issue Sep 30, 2017 · 21 comments · May be fixed by #356

Comments

@srbcheema1
Copy link
Owner

srbcheema1 commented Sep 30, 2017

algorithm implementation in java , python ,c is required .
make sure that your code is clean and readable

@Alastifer
Copy link
Contributor

@srbcheema1 can I write dijkstra algo in Java?

@srbcheema1
Copy link
Owner Author

sure @Alastifer i will be glad to see your contribution :)
go for it

srbcheema1 added a commit that referenced this issue Oct 1, 2017
achaJackson added a commit to achaJackson/Algo_Ds that referenced this issue Oct 1, 2017
@Alastifer
Copy link
Contributor

Alastifer commented Oct 1, 2017

@srbcheema1 #45 added Dijkstra algorithm

achaJackson added a commit to achaJackson/Algo_Ds that referenced this issue Oct 1, 2017
srbcheema1 added a commit that referenced this issue Oct 1, 2017
Add Stack implementation in Java #20
@srbcheema1
Copy link
Owner Author

thanks @Alastifer for the Dijkstra Algorithm
i would be glad to see more contributions .
i will suggest you other graph algorithms
you may do prim krushkal or any you may feel comfortable
and also not to forget to STAR the repo

srbcheema1 added a commit that referenced this issue Oct 1, 2017
#20. Added and implemented counting sort with java.
@sirjan13
Copy link
Contributor

sirjan13 commented Oct 1, 2017

added python implementation for singly linked list in Python PR #52

@Delkhaz
Copy link

Delkhaz commented Oct 1, 2017

added c++ implementation for tower_of_hanoi

@srbcheema1
Copy link
Owner Author

thanks @sirjan13 @Delkhaz
thanks for contributions ..
keep contributing ..
keep coding ..
stay happy

achaJackson added a commit to achaJackson/Algo_Ds that referenced this issue Oct 2, 2017
achaJackson added a commit to achaJackson/Algo_Ds that referenced this issue Oct 2, 2017
@NishantTanwar
Copy link
Contributor

Can I go for segment trees with lazy propagation? Currently it is not there. @srbcheema1

@arijitkar98
Copy link

@srbcheema1 Can i write cpp code for closest points and ordered statistics (Divide and Conquer) ?

srbcheema1 added a commit that referenced this issue Oct 3, 2017
#20. Generating and Implementing a Power set with Java
@srbcheema1
Copy link
Owner Author

@arijitkar98
go for it :)

@siddharthnarula
Copy link

Added HeapSort.cpp
#include
#include<conio.h>
#include<dos.h>
#include<time.h>
#include<stdlib.h>
#include<windows.h>
using namespace std;

void heapify(int arr[], int n, int i)
{
int largest = i; // Initialize largest as root
int l = 2i + 1; // left = 2i + 1
int r = 2i + 2; // right = 2i + 2

// If left child is larger than root
if (l < n && arr[l] > arr[largest])
    largest = l;

// If right child is larger than largest so far
if (r < n && arr[r] > arr[largest])
    largest = r;

// If largest is not root
if (largest != i)
{
    swap(arr[i], arr[largest]);

    // Recursively heapify the affected sub-tree
    Sleep(1000);
    heapify(arr, n, largest);
}

}

// main function to do heap sort
void heapSort(int arr[], int n)
{
// Build heap (rearrange array)
for (int i = n / 2 - 1; i >= 0; i--)
heapify(arr, n, i);

// One by one extract an element from heap
for (int i=n-1; i>=0; i--)
{
    // Move current root to end
    swap(arr[0], arr[i]);

    // call max heapify on the reduced heap
    heapify(arr, i, 0);
}

}

void printArray(int arr[], int size)
{
int i;
for (i = 0; i < size; i++)
cout << arr[i] << " ";
cout << endl;
}
int main()
{
clock_t start,end;
int arr[100],n=25;
for(int i=0;i<n;i++)
{
arr[i] = (rand()%100+1);
cout << arr[i] << endl;
}
//int n = sizeof(arr)/sizeof(arr[0]);
start=clock();
heapSort(arr,n);
end=clock();
cout<<"Sorted array: \n";
printArray(arr, n);
float t=(end-start)/CLK_TCK;
cout<<"\n Time Taken is"<<t;
return 0;
}

@therohanjaiswal
Copy link

I added Bubble Sort algorithm in Java.

@Prachi-05
Copy link

Prim's algorithm

@MayankSingh173
Copy link

I would like to add priority queues implementation

@SrushtiPatiL25
Copy link

I would like to add bubble sort and selection sort in CPP.
can you assign me for it?
I am trying to do successful PR's for hactoberfest.
can I work on it?

@devbhansingh
Copy link

i would like to add binary search algorithm in cpp

@crisevangelene
Copy link

@srbcheema1 Can I contribute on BFS Traversal here ?

@yyds5 yyds5 linked a pull request Oct 14, 2021 that will close this issue
@Prashantkumar963
Copy link

hello sir can I add bst traversal cpp

@IshaShk
Copy link

IshaShk commented Oct 14, 2022

Greetings Sir ,
It would be great if you assign me this problem as i have good knowledge about DSA and have been working on it from a long time.
Thank you

@simran2002
Copy link

@srbcheema1
can I add Python code for Doubly Linked List??

Regards

@ankitkumar0622
Copy link

can you please assign this to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.