srbcheema1 / Algo_Ds

Repository for cool algorithms and Datastructures
182 stars 307 forks source link

Add algorithms in different languages #20

Open srbcheema1 opened 7 years ago

srbcheema1 commented 7 years ago

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

Alastifer commented 7 years ago

@srbcheema1 can I write dijkstra algo in Java?

srbcheema1 commented 7 years ago

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

Alastifer commented 7 years ago

@srbcheema1 #45 added Dijkstra algorithm

srbcheema1 commented 7 years ago

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

sirjan13 commented 7 years ago

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

Delkhaz commented 7 years ago

added c++ implementation for tower_of_hanoi

srbcheema1 commented 7 years ago

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

NishantTanwar commented 7 years ago

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

arijitkar98 commented 7 years ago

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

srbcheema1 commented 7 years ago

@arijitkar98 go for it :)

siddharthnarula commented 5 years ago

Added HeapSort.cpp

include

include

include

include

include

include

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 commented 5 years ago

I added Bubble Sort algorithm in Java.

Prachi-05 commented 5 years ago

Prim's algorithm

MayankSingh173 commented 4 years ago

I would like to add priority queues implementation

SrushtiPatiL25 commented 4 years ago

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 commented 4 years ago

i would like to add binary search algorithm in cpp

crisevangelene commented 3 years ago

@srbcheema1 Can I contribute on BFS Traversal here ?

Prashantkumar963 commented 2 years ago

hello sir can I add bst traversal cpp

IshaShk commented 2 years ago

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 commented 2 years ago

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

Regards

ankitkumar0622 commented 2 years ago

can you please assign this to me?