Algo_Ds icon indicating copy to clipboard operation
Algo_Ds copied to clipboard

Add algorithms in different languages

Open srbcheema1 opened this issue 7 years ago • 21 comments

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

srbcheema1 avatar Sep 30 '17 23:09 srbcheema1

@srbcheema1 can I write dijkstra algo in Java?

Alastifer avatar Oct 01 '17 07:10 Alastifer

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

srbcheema1 avatar Oct 01 '17 08:10 srbcheema1

@srbcheema1 #45 added Dijkstra algorithm

Alastifer avatar Oct 01 '17 11:10 Alastifer

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 avatar Oct 01 '17 13:10 srbcheema1

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

sirjan13 avatar Oct 01 '17 16:10 sirjan13

added c++ implementation for tower_of_hanoi

Delkhaz avatar Oct 01 '17 17:10 Delkhaz

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

srbcheema1 avatar Oct 02 '17 00:10 srbcheema1

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

NishantTanwar avatar Oct 02 '17 23:10 NishantTanwar

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

arijitkar98 avatar Oct 03 '17 10:10 arijitkar98

@arijitkar98 go for it :)

srbcheema1 avatar Oct 03 '17 13:10 srbcheema1

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; }

siddharthnarula avatar Oct 09 '19 15:10 siddharthnarula

I added Bubble Sort algorithm in Java.

therohanjaiswal avatar Oct 11 '19 19:10 therohanjaiswal

Prim's algorithm

Prachi-05 avatar Oct 13 '19 05:10 Prachi-05

I would like to add priority queues implementation

MayankSingh173 avatar Sep 30 '20 16:09 MayankSingh173

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?

SrushtiPatiL25 avatar Oct 07 '20 14:10 SrushtiPatiL25

i would like to add binary search algorithm in cpp

devbhansingh avatar Oct 23 '20 14:10 devbhansingh

@srbcheema1 Can I contribute on BFS Traversal here ?

crisevangelene avatar Oct 04 '21 15:10 crisevangelene

hello sir can I add bst traversal cpp

Prashantkumar963 avatar Oct 12 '22 18:10 Prashantkumar963

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

IshaShk avatar Oct 14 '22 08:10 IshaShk

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

Regards

simran2002 avatar Oct 21 '22 06:10 simran2002

can you please assign this to me?

ankitkumar0622 avatar Oct 21 '22 06:10 ankitkumar0622