Open srbcheema1 opened 7 years ago
@srbcheema1 can I write dijkstra algo in Java?
sure @Alastifer i will be glad to see your contribution :) go for it
@srbcheema1 #45 added Dijkstra algorithm
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
added python implementation for singly linked list in Python PR #52
added c++ implementation for tower_of_hanoi
thanks @sirjan13 @Delkhaz thanks for contributions .. keep contributing .. keep coding .. stay happy
Can I go for segment trees with lazy propagation? Currently it is not there. @srbcheema1
@srbcheema1 Can i write cpp code for closest points and ordered statistics (Divide and Conquer) ?
@arijitkar98 go for it :)
Added HeapSort.cpp
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; }
I added Bubble Sort algorithm in Java.
Prim's algorithm
I would like to add priority queues implementation
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?
i would like to add binary search algorithm in cpp
@srbcheema1 Can I contribute on BFS Traversal here ?
hello sir can I add bst traversal cpp
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
@srbcheema1 can I add Python code for Doubly Linked List??
Regards
can you please assign this to me?
algorithm implementation in java , python ,c is required . make sure that your code is clean and readable