├── DSA_Codesheet ├── Cpp │ ├── triplet_sum.exe │ ├── sort012.cpp │ ├── insertion_sort.cpp │ ├── README.md │ ├── pascalTriangle.cpp │ ├── shell_sort.cpp │ ├── Selection_Sort.cpp │ ├── triplet_sum.cpp │ ├── RemoveNthfromEnd.cpp │ ├── Search_Rotated_SortedArray.cpp │ ├── cycle_sort.cpp │ └── MergeSort.cpp ├── C │ ├── selection_sort.c │ ├── sort012.c │ ├── insertion_sort.c │ ├── README.md │ ├── remove_node.c │ ├── merge_sort.c │ ├── cycle_sort.c │ ├── treetransversal.c │ └── Search_Rotated_SortedArray.cpp ├── Python │ ├── remove_node.py │ ├── insertion_Sort.py │ ├── triplet_sum.py │ ├── README.md │ ├── Selection_Sort.py │ ├── countingSort.py │ ├── sort012.py │ └── Tree_Traversal.py └── Java │ ├── remove_node.java │ ├── InsertionSort.java │ ├── cycle_sort.java │ ├── Triplet_Sum.java │ ├── README.md │ ├── SelectionSort.java │ ├── Sort_0_1_2.java │ ├── MergeSort.java │ ├── countSort.java │ └── Rotated_sorted_array.java ├── .github ├── workflows │ └── main.yml └── ISSUE_TEMPLATE │ └── dsa-question-template.md ├── LICENSE ├── CONTRIBUTING.md └── README.md /DSA_Codesheet/Cpp/triplet_sum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chitresh-code/DSA_Worksheet/HEAD/DSA_Codesheet/Cpp/triplet_sum.exe -------------------------------------------------------------------------------- /DSA_Codesheet/C/selection_sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int compare(const void *a, const void *b) { 5 | return (*(int*)a - *(int*)b); 6 | } 7 | 8 | int main() { 9 | int arr[] = {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5}; 10 | int n = sizeof(arr) / sizeof(arr[0]); 11 | 12 | qsort(arr, n, sizeof(int), compare); 13 | 14 | for (int i = 0; i < n; i++) { 15 | printf("%d ", arr[i]); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | 6 | jobs: 7 | contrib-readme-job: 8 | permissions: write-all 9 | runs-on: ubuntu-latest 10 | name: A job to automate contrib in readme 11 | steps: 12 | - name: Contribute List 13 | uses: akhilmhdh/contributors-readme-action@v2.3.6 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /DSA_Codesheet/C/sort012.c: -------------------------------------------------------------------------------- 1 | #include 2 | void sort012(int *arr, int n) { 3 | int k = 0; 4 | int occurences[2] = {0, 0}; 5 | 6 | for(int i = 0; i < n; i++) { 7 | if(arr[i] == 0) { 8 | arr[k] = 0; 9 | k++; 10 | } else { 11 | occurences[arr[i]-1]++; 12 | } 13 | } 14 | 15 | for(int i = 0; i < 2; i++) { 16 | for(int j = 0; j < occurences[i]; j++) { 17 | arr[k] = i+1; 18 | k++; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/sort012.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | void sort012(int *arr, int n) 3 | { 4 | int k = 0; 5 | int occurences[2] = {0,0}; 6 | 7 | for(int i = 0; i < n; i++) { 8 | if(arr[i] == 0) { 9 | arr[k] = 0; 10 | k++; 11 | } else { 12 | occurences[arr[i]-1]++; 13 | } 14 | } 15 | 16 | for(int i = 0; i < 2; i++) { 17 | for(int j = 0; j < occurences[i]; j++) { 18 | arr[k] = i+1; 19 | k++; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DSA_Codesheet/Python/remove_node.py: -------------------------------------------------------------------------------- 1 | class ListNode: 2 | def __init__(self, val=0, next=None): 3 | self.val = val 4 | self.next = next 5 | 6 | def removeNthFromEnd(head, n): 7 | dummy = ListNode(0) 8 | dummy.next = head 9 | first = dummy 10 | second = dummy 11 | 12 | 13 | for _ in range(n+1): 14 | first = first.next 15 | 16 | 17 | while first: 18 | first = first.next 19 | second = second.next 20 | 21 | second.next = second.next.next 22 | 23 | return dummy.next 24 | -------------------------------------------------------------------------------- /DSA_Codesheet/C/insertion_sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main(){ 3 | int n; 4 | printf("Enter the size of array:"); 5 | scanf("%d",&n); 6 | printf("Enter the unsorted array:"); 7 | int arr[n]; 8 | for(int i=0;icurrent &&j>=0){ 15 | arr[j+1]=arr[j]; 16 | j--; 17 | } 18 | arr[j+1]=current; 19 | } 20 | printf("sorted list:\n"); 21 | for(int i=0;i 2 | using namespace std; 3 | int main(){ 4 | int n; 5 | cout<<"Enter the size of array:"; 6 | cin>>n; 7 | cout<<"Enter the unsorted array:"<>arr[i]; 11 | } 12 | for(int i=1;icurrent &&j>=0){ 16 | arr[j+1]=arr[j]; 17 | j--; 18 | } 19 | arr[j+1]=current; 20 | } 21 | cout<<"sorted list:"; 22 | for(int i=0;i= 0 and key < arr[j]: 10 | arr[j + 1] = arr[j] 11 | j -= 1 12 | arr[j + 1] = key 13 | 14 | return arr 15 | 16 | 17 | 18 | arr = input("Enter a list of numbers: ").split(" ") 19 | 20 | arr = [int(i) for i in arr] 21 | 22 | sorted_arr = insertion_sort(arr) 23 | 24 | for i in sorted_arr: 25 | print(i,end=' ') -------------------------------------------------------------------------------- /DSA_Codesheet/Java/remove_node.java: -------------------------------------------------------------------------------- 1 | class ListNode { 2 | int val; 3 | ListNode next; 4 | ListNode(int val) { 5 | this.val = val; 6 | } 7 | } 8 | 9 | public ListNode removeNthFromEnd(ListNode head, int n) { 10 | ListNode dummy = new ListNode(0); 11 | dummy.next = head; 12 | ListNode first = dummy; 13 | ListNode second = dummy; 14 | 15 | 16 | for (int i = 0; i <= n; i++) { 17 | first = first.next; 18 | } 19 | 20 | 21 | while (first != null) { 22 | first = first.next; 23 | second = second.next; 24 | } 25 | 26 | 27 | second.next = second.next.next; 28 | 29 | return dummy.next; 30 | } 31 | -------------------------------------------------------------------------------- /DSA_Codesheet/Python/triplet_sum.py: -------------------------------------------------------------------------------- 1 | def find_triplet_sum(arr, n, X): 2 | # Sort the input array 3 | arr.sort() 4 | 5 | for i in range(n - 2): 6 | left = i + 1 7 | right = n - 1 8 | 9 | while left < right: 10 | current_sum = arr[i] + arr[left] + arr[right] 11 | 12 | if current_sum == X: 13 | return 1 # Triplet found 14 | 15 | if current_sum < X: 16 | left += 1 17 | else: 18 | right -= 1 19 | 20 | return 0 # No triplet found 21 | 22 | # Input 23 | n, X = map(int, input().split()) 24 | arr = list(map(int, input().split())) 25 | 26 | # Check if a triplet with the given sum X exists in the array 27 | result = find_triplet_sum(arr, n, X) 28 | print(result) 29 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/InsertionSort.java: -------------------------------------------------------------------------------- 1 | public class InsertionSort { 2 | 3 | public static void insertionSort(int arr[]) { 4 | int n = arr.length; 5 | for (int i = 1; i < n; ++i) { 6 | int key = arr[i]; 7 | int j = i - 1; 8 | 9 | while (j >= 0 && arr[j] > key) { 10 | arr[j + 1] = arr[j]; 11 | j = j - 1; 12 | } 13 | arr[j + 1] = key; 14 | } 15 | } 16 | 17 | 18 | public static void main(String args[]) { 19 | int arr[] = {18, 0, 11, 1, 24, 91, 100}; 20 | int n = arr.length; 21 | 22 | insertionSort(arr); 23 | 24 | for (int i = 0; i < n; ++i) 25 | System.out.print(arr[i] + " "); 26 | 27 | System.out.println(); 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/cycle_sort.java: -------------------------------------------------------------------------------- 1 | public class cycle_sort { 2 | public static void main(String[] args) { 3 | long[] arr = {1,2,4,5,1}; 4 | dupmis(arr, arr.length); 5 | 6 | } 7 | static void dupmis(long[] arr,long n){ 8 | long sum = (n*(n+1))/2; 9 | long squaresum = (n*(n+1)*((2*n+1)))/6; 10 | long s1 = 0; //sum of array elements 11 | long s2 = 0; //sum of square of array elements 12 | for (int i = 0; i < n; i++) { 13 | s1 += arr[i]; 14 | s2 += (arr[i]*arr[i]); 15 | } 16 | long val1 = s1-sum; //x-y 17 | long val2 = s2-squaresum; 18 | val2 = val2/val1; 19 | long x = (val1+val2)/2; 20 | long y = x-val1; 21 | System.out.print(x+" "); 22 | System.out.print(y); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/Triplet_Sum.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | 3 | public class Triplet_Sum { 4 | public static void main(String[] args) { 5 | int[] arr = {1,2,4,3,6}; 6 | System.out.println(threeSum(arr,10)); 7 | 8 | } 9 | static boolean threeSum(int[] arr,int x){ 10 | Arrays.sort(arr); 11 | int n = arr.length; 12 | for (int i = 0; i < n; i++) { 13 | int j = i+1; 14 | int k = arr.length-1; 15 | while (j 2 | #include 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | vector> generate(int numRows) { 8 | vector> r(numRows); 9 | for(int i = 0; i < numRows; i++) { 10 | r[i].resize(i + 1); 11 | r[i][0] = r[i][i] = 1; 12 | 13 | for(int j = 1; j < i; j++) 14 | r[i][j] = r[i - 1][j - 1] + r[i - 1][j]; 15 | } 16 | return r; 17 | } 18 | }; 19 | 20 | int main() { 21 | Solution solution; 22 | int numRows; 23 | 24 | cout << "Enter the number of rows for Pascal's Triangle: "; 25 | cin >> numRows; 26 | 27 | vector> result = solution.generate(numRows); 28 | 29 | for (const vector& row : result) { 30 | for (int num : row) { 31 | cout << num << " "; 32 | } 33 | cout << endl; 34 | } 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /DSA_Codesheet/Python/countingSort.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | def sortArray(N: List[int]) -> List[int]: 4 | min_val, max_val = min(N), max(N) 5 | count = [0] * (max_val - min_val + 1) 6 | 7 | for num in N: 8 | count[num - min_val] += 1 9 | 10 | sorted_array = [] 11 | for i in range(len(count)): 12 | sorted_array.extend([i + min_val] * count[i]) 13 | 14 | return sorted_array 15 | 16 | if __name__ == "__main__": 17 | # Input 18 | n = int(input("Enter the number of elements: ")) 19 | user_input = list(map(int, input("Enter the elements separated by spaces: ").split())) 20 | 21 | # Output the array before sorting 22 | print("Array Before Sorting :-") 23 | print(" ".join(map(str, user_input))) 24 | 25 | # Sort the array 26 | sorted_list = sortArray(user_input) 27 | 28 | # Output the array after sorting 29 | print("Array After Sorting :-") 30 | print(" ".join(map(str, sorted_list))) 31 | -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/shell_sort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | // A function implementing Shell sort. 6 | void ShellSort(int a[], int n) 7 | { 8 | int i, j, k, temp; 9 | // Gap 'i' between index of the element to be compared, initially n/2. 10 | for(i = n/2; i > 0; i = i/2) 11 | { 12 | for(j = i; j < n; j++) 13 | { 14 | for(k = j-i; k >= 0; k = k-i) 15 | { 16 | // If value at higher index is greater, then break the loop. 17 | if(a[k+i] >= a[k]) 18 | break; 19 | // Switch the values otherwise. 20 | else 21 | { 22 | temp = a[k]; 23 | a[k] = a[k+i]; 24 | a[k+i] = temp; 25 | } 26 | } 27 | } 28 | } 29 | } 30 | int main() 31 | { 32 | int n, i; 33 | cout<<"\nEnter the number of data element to be sorted: "; 34 | cin>>n; 35 | 36 | int arr[n]; 37 | for(i = 0; i < n; i++) 38 | { 39 | cout<<"Enter element "<>arr[i]; 41 | } 42 | 43 | ShellSort(arr, n); 44 | 45 | // Printing the sorted data. 46 | cout<<"\nSorted Data "; 47 | for (i = 0; i < n; i++) 48 | cout<<"->"< 4 | using namespace std; 5 | 6 | void selectionSort(int arr[], int n) { 7 | for(int i=0; i> n; 23 | 24 | int arr[n]; 25 | 26 | for(int i=0; i> arr[i]; 28 | } 29 | 30 | selectionSort(arr, n); 31 | 32 | for(int i=0; i 2 | using namespace std; 3 | 4 | class Solution{ 5 | public: 6 | //Function to find if there exists a triplet in the 7 | //array A[] which sums up to X. 8 | bool find3Numbers(int A[], int n, int X) 9 | { 10 | int i = 0; 11 | sort(A , A + n); 12 | for(int i = 0; i < n; i++) 13 | { 14 | int left = i + 1; 15 | int right = n - 1; 16 | while(left < right) 17 | { 18 | int sum = A[i] + A[left] + A[right]; 19 | if(sum == X) 20 | { 21 | i = 1; 22 | return i; 23 | } 24 | if(sum < X) 25 | { 26 | left++; 27 | } 28 | else 29 | { 30 | right--; 31 | } 32 | } 33 | } 34 | return 0; 35 | } 36 | 37 | }; 38 | 39 | int main() 40 | { 41 | int T; 42 | cin>>T; 43 | while(T--) 44 | { 45 | int n,X; 46 | cin>>n>>X; 47 | int i,A[n]; 48 | for(i=0;i>A[i]; 50 | Solution ob; 51 | cout << ob.find3Numbers(A, n, X) << endl; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /DSA_Codesheet/Python/Tree_Traversal.py: -------------------------------------------------------------------------------- 1 | #tree traversal in python 2 | class Node: 3 | def __init__(self,item): 4 | 5 | self.left = None 6 | self.right = None 7 | self.val = item 8 | def inorder(root): 9 | if root: 10 | #traverse left 11 | inorder(root.left) 12 | #traverse root 13 | print(str(root.val)+ "->", end='') 14 | #traverse right 15 | inorder(root.right) 16 | 17 | def postorder(root): 18 | if root: 19 | #traverse left 20 | postorder(root.left) 21 | #traverse right 22 | postorder(root.right) 23 | #traverse root 24 | print(str(root.val)+ "->", end='') 25 | 26 | def preorder(root): 27 | if root: 28 | #traverse root 29 | print(str(root.val)+ "->", end='') 30 | #traverse left 31 | preorder(root.left) 32 | #traverse right 33 | preorder(root.right) 34 | 35 | root = Node(1) 36 | root.left = Node(2) 37 | root.right = Node(3) 38 | root.left.left = Node(4) 39 | root.left.right = Node(5) 40 | 41 | 42 | print("Inorder traversal") 43 | inorder(root) 44 | print("\nPreorder traversal") 45 | preorder(root) 46 | print("\nPostorder traversal") 47 | postorder(root) 48 | 49 | 50 | -------------------------------------------------------------------------------- /DSA_Codesheet/C/remove_node.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct ListNode { 5 | int val; 6 | struct ListNode *next; 7 | }; 8 | 9 | struct ListNode *removeNthFromEnd(struct ListNode *head, int n) { 10 | struct ListNode *dummy = (struct ListNode *)malloc(sizeof(struct ListNode)); 11 | dummy->next = head; 12 | struct ListNode *first = dummy; 13 | struct ListNode *second = dummy; 14 | 15 | 16 | for (int i = 0; i <= n; i++) { 17 | first = first->next; 18 | } 19 | 20 | 21 | while (first != NULL) { 22 | first = first->next; 23 | second = second->next; 24 | } 25 | 26 | 27 | struct ListNode *temp = second->next; 28 | second->next = temp->next; 29 | free(temp); 30 | 31 | return dummy->next; 32 | } 33 | 34 | int main() { 35 | 36 | struct ListNode *head = (struct ListNode *)malloc(sizeof(struct ListNode)); 37 | head->val = 1; 38 | head->next = NULL; 39 | 40 | 41 | int n = 1; // Change this to the desired n value 42 | struct ListNode *newHead = removeNthFromEnd(head, n); 43 | 44 | 45 | struct ListNode *current = newHead; 46 | while (current != NULL) { 47 | printf("%d ", current->val); 48 | current = current->next; 49 | } 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/dsa-question-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: DSA Question Template 3 | about: Follow this template if you want to publish a DSA Question as an issue in this 4 | repository. 5 | title: Question Name 6 | labels: C++, good first issue, hacktoberfest, hacktoberfest-2023, hacktoberfest-accepted, 7 | Java, python, question 8 | assignees: '' 9 | 10 | --- 11 | 12 | ❗**Write Code in Only One Language** (CPP, C, Java, Python) 13 | 14 | ## Give File Name : ✅ In respective language folder 15 | 16 | # 📑 DESCRIPTION 17 | 18 | ### Problem Title 19 | 20 | ![Difficulty](https://img.shields.io/badge/Difficulty-Level_of_Difficulty-brightgreen) 21 | 22 | **Problem Statement:** 23 | Explain the problem 24 | 25 | **Note:** 26 | If any 27 | 28 | **Input Format:** 29 | ``` 30 | Input format here 31 | ``` 32 | **Output Format:** 33 | ``` 34 | Output format here 35 | ``` 36 | 37 | **Example** 38 | ``` 39 | Example 40 | 41 | ``` 42 | 43 | **Sample Input 1** 44 | ``` 45 | Sample input 1 46 | ``` 47 | 48 | **Sample Output 1** 49 | ``` 50 | Sample output 1 51 | ``` 52 | 53 | **Sample Input 2** 54 | ``` 55 | Sample input 2 56 | ``` 57 | 58 | **Sample Output 2** 59 | ``` 60 | Sample output 2 61 | ``` 62 | 63 | **Constraints** 64 | ``` 65 | Constraints and complexity 66 | ``` 67 | 68 | [Link of Problem If Copied from Some Site](https://github.com/Chitresh-code/DSA_Worksheet) 69 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/SelectionSort.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class SelectionSort { 4 | public static void selectionSort(int[] arr) { 5 | int n = arr.length; 6 | 7 | for (int i = 0; i < n - 1; i++) { 8 | // Find the minimum element in the unsorted portion of the array 9 | int minIndex = i; 10 | for (int j = i + 1; j < n; j++) { 11 | if (arr[j] < arr[minIndex]) { 12 | minIndex = j; 13 | } 14 | } 15 | 16 | // Swap the found minimum element with the element at index i 17 | int temp = arr[i]; 18 | arr[i] = arr[minIndex]; 19 | arr[minIndex] = temp; 20 | } 21 | } 22 | 23 | public static void main(String[] args) { 24 | Scanner scanner = new Scanner(System.in); 25 | 26 | int n = scanner.nextInt(); 27 | 28 | int[] arr = new int[n]; 29 | 30 | for (int i = 0; i < n; i++) { 31 | arr[i] = scanner.nextInt(); 32 | } 33 | 34 | selectionSort(arr); 35 | 36 | System.out.println("Sorted array:"); 37 | for (int value : arr) { 38 | System.out.print(value + " "); 39 | } 40 | 41 | // Close the scanner to free up resources 42 | scanner.close(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/RemoveNthfromEnd.cpp: -------------------------------------------------------------------------------- 1 | // deleting a node from end 2 | #include 3 | using namespace std; 4 | 5 | struct Node { 6 | int data; 7 | struct Node* next; 8 | Node(int value) 9 | { 10 | this->data = value; 11 | this->next = NULL; 12 | } 13 | }; 14 | 15 | int length(Node* head) 16 | { 17 | Node* temp = head; 18 | int count = 0; 19 | while (temp != NULL) { 20 | count++; 21 | temp = temp->next; 22 | } 23 | return count; 24 | } 25 | 26 | void printList(Node* head) 27 | { 28 | Node* ptr = head; 29 | while (ptr != NULL) { 30 | cout << ptr->data << " "; 31 | ptr = ptr->next; 32 | } 33 | cout << endl; 34 | } 35 | 36 | Node* deleteNthNodeFromEnd(Node* head, int n) 37 | { 38 | int Length = length(head); 39 | int nodeFromBeginning = Length - n + 1; 40 | Node* prev = NULL; 41 | Node* temp = head; 42 | for (int i = 1; i < nodeFromBeginning; i++) { 43 | prev = temp; 44 | temp = temp->next; 45 | } 46 | if (prev == NULL) { 47 | head = head->next; 48 | return head; 49 | } 50 | else { 51 | prev->next = prev->next->next; 52 | return head; 53 | } 54 | } 55 | 56 | int main() 57 | { 58 | Node* head = new Node(1); 59 | head->next = new Node(2); 60 | head->next->next = new Node(3); 61 | head->next->next->next = new Node(4); 62 | head->next->next->next->next = new Node(5); 63 | 64 | head = deleteNthNodeFromEnd(head, 1); 65 | 66 | printList(head); 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/Sort_0_1_2.java: -------------------------------------------------------------------------------- 1 | package DSA_Worksheet.DSA_Codesheet.Java; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Sort_0_1_2 { 6 | public static void main(String[] args) { 7 | Scanner s = new Scanner(System.in); 8 | int t = s.nextInt();//number of test cases 9 | System.out.println(); 10 | for (int i = 0; i < t; i++) { 11 | int n = s.nextInt(); //size of an array 12 | int[] arr = new int[n]; 13 | for (int j = 0; j < n; j++) { 14 | arr[i] = s.nextInt(); //taking input of array elements 15 | } 16 | sort0_1_2(arr); 17 | //printing array elements 18 | for (int j = 0; j < n; j++) { 19 | System.out.print(arr[i]+" "); 20 | } 21 | } 22 | } 23 | 24 | static int[] sort0_1_2(int[] arr){ 25 | int l = 0; 26 | int mid = 0; 27 | int h = arr.length-1; 28 | while (mid<=h){ 29 | if(arr[mid]==0){ 30 | int temp = arr[l]; 31 | arr[l] = arr[mid]; //swapping 32 | arr[mid] = temp; 33 | l++; 34 | mid++; 35 | } else if (arr[mid]==1) { 36 | mid++; 37 | }else{ 38 | int temp = arr[mid]; //swapping 39 | arr[mid] = arr[h]; 40 | arr[h] = temp; 41 | h--; 42 | } 43 | } 44 | return arr; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/Search_Rotated_SortedArray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | int searchInRotatedArray(const vector& nums, int target) { 7 | int low = 0, high = nums.size() - 1; 8 | 9 | while (low <= high) { 10 | int mid = low + (high - low) / 2; 11 | 12 | if (nums[mid] == target) { 13 | return mid; // Found the target 14 | } 15 | 16 | // Check if the left half is sorted 17 | if (nums[low] <= nums[mid]) { 18 | // Check if the target lies in the left half 19 | if (nums[low] <= target && target < nums[mid]) { 20 | high = mid - 1; 21 | } else { 22 | low = mid + 1; 23 | } 24 | } else { // Right half is sorted 25 | // Check if the target lies in the right half 26 | if (nums[mid] < target && target <= nums[high]) { 27 | low = mid + 1; 28 | } else { 29 | high = mid - 1; 30 | } 31 | } 32 | } 33 | 34 | return -1; // Target not found 35 | } 36 | 37 | int main() { 38 | cout << "Enter the size of the rotated sorted array: "; 39 | int n; 40 | cin >> n; 41 | 42 | cout << "Enter the elements of the rotated sorted array: "; 43 | vector rotatedArray(n); 44 | for (int i = 0; i < n; ++i) { 45 | cin >> rotatedArray[i]; 46 | } 47 | 48 | int target; 49 | cout << "Enter the target element to search: "; 50 | cin >> target; 51 | 52 | int result = searchInRotatedArray(rotatedArray, target); 53 | 54 | if (result != -1) { 55 | cout << "Element " << target << " found at index " << result << endl; 56 | } else { 57 | cout << "Element " << target << " not found in the array" << endl; 58 | } 59 | 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/MergeSort.java: -------------------------------------------------------------------------------- 1 | public class MergeSort { 2 | 3 | public static void merge(int[] arr, int left, int mid, int right) { 4 | int n1 = mid - left + 1; 5 | int n2 = right - mid; 6 | 7 | int[] leftArr = new int[n1]; 8 | int[] rightArr = new int[n2]; 9 | 10 | for (int i = 0; i < n1; ++i) 11 | leftArr[i] = arr[left + i]; 12 | 13 | for (int j = 0; j < n2; ++j) 14 | rightArr[j] = arr[mid + 1 + j]; 15 | 16 | int i = 0, j = 0; 17 | 18 | int k = left; 19 | while (i < n1 && j < n2) { 20 | if (leftArr[i] <= rightArr[j]) { 21 | arr[k] = leftArr[i]; 22 | i++; 23 | } else { 24 | arr[k] = rightArr[j]; 25 | j++; 26 | } 27 | k++; 28 | } 29 | 30 | while (i < n1) { 31 | arr[k] = leftArr[i]; 32 | i++; 33 | k++; 34 | } 35 | 36 | while (j < n2) { 37 | arr[k] = rightArr[j]; 38 | j++; 39 | k++; 40 | } 41 | } 42 | 43 | public static void mergeSort(int[] arr, int left, int right) { 44 | if (left < right) { 45 | int mid = (left + right) / 2; 46 | 47 | mergeSort(arr, left, mid); 48 | mergeSort(arr, mid + 1, right); 49 | 50 | merge(arr, left, mid, right); 51 | } 52 | } 53 | 54 | public static void main(String[] args) { 55 | int[] arr = {10,22,12,15,18,16,19,20,28}; 56 | 57 | System.out.println("Original array:"); 58 | for (int value : arr) { 59 | System.out.print(value + " "); 60 | } 61 | 62 | mergeSort(arr, 0, arr.length - 1); 63 | 64 | System.out.println("\nSorted array:"); 65 | for (int value : arr) { 66 | System.out.print(value + " "); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/cycle_sort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void cycleSort (int arr[], int n) 5 | { 6 | // count number of memory writes 7 | int writes = 0; 8 | 9 | // traverse array elements and put it to on the right place 10 | 11 | for (int i=0; i<=n-2; i++) 12 | { 13 | int item = arr[i]; 14 | 15 | int pos = i; 16 | for (int j = i+1; j max) { 58 | max = num; 59 | } 60 | if(num < min) { 61 | min = num; 62 | } 63 | } 64 | return new int[]{min, max}; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DSA_Codesheet/C/merge_sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // Merges two subarrays of arr[]. 6 | // First subarray is arr[l..m] 7 | // Second subarray is arr[m+1..r] 8 | void merge(int arr[], int l, 9 | int m, int r) 10 | { 11 | int i, j, k; 12 | int n1 = m - l + 1; 13 | int n2 = r - m; 14 | 15 | // Create temp arrays 16 | int L[n1], R[n2]; 17 | 18 | // Copy data to temp arrays 19 | for (i = 0; i < n1; i++) 20 | {L[i] = arr[l + i]; 21 | } 22 | for (j = 0; j < n2; j++) 23 | {R[j] = arr[m + 1 + j]; 24 | } 25 | 26 | // Merge the temp arrays back 27 | // into arr[l..r] 28 | 29 | i = 0; 30 | j = 0; 31 | k = l; 32 | while (i < n1 && j < n2) 33 | { 34 | if (L[i] <= R[j]) 35 | { 36 | arr[k] = L[i]; 37 | i++; 38 | } 39 | else 40 | { 41 | arr[k] = R[j]; 42 | j++; 43 | } 44 | k++; 45 | } 46 | 47 | // Copy the remaining elements 48 | // of L[] 49 | while (i < n1) { 50 | arr[k] = L[i]; 51 | i++; 52 | k++; 53 | } 54 | 55 | // Copy the remaining elements of 56 | // R[] 57 | while (j < n2) 58 | { 59 | arr[k] = R[j]; 60 | j++; 61 | k++; 62 | } 63 | } 64 | 65 | void mergeSort(int arr[], 66 | int l, int r) 67 | { 68 | if (l < r) 69 | { 70 | int m = l + (r - l) / 2; 71 | 72 | // Sort first and second halves 73 | mergeSort(arr, l, m); 74 | mergeSort(arr, m + 1, r); 75 | 76 | merge(arr, l, m, r); 77 | } 78 | } 79 | 80 | // Function to print an array 81 | void printArray(int A[], int size) 82 | { 83 | int i; 84 | for (i = 0; i < size; i++) 85 | printf("%d ", A[i]); 86 | printf("\n"); 87 | } 88 | 89 | int main() 90 | { 91 | int arr[] = {12, 11, 13, 5, 6, 7}; 92 | int arr_size = sizeof(arr) / sizeof(arr[0]); 93 | 94 | printf("Given array is \n"); 95 | printArray(arr, arr_size); 96 | 97 | mergeSort(arr, 0, arr_size - 1); 98 | 99 | printf("\nSorted array is \n"); 100 | printArray(arr, arr_size); 101 | return 0; 102 | } -------------------------------------------------------------------------------- /DSA_Codesheet/C/cycle_sort.c: -------------------------------------------------------------------------------- 1 | #include 2 | void cycleSort (int arr[], int n) 3 | { 4 | // count number of memory writes 5 | int writes = 0; 6 | 7 | // traverse array elements and put it to on the right place 8 | 9 | for (int i=0; i<=n-2; i++) 10 | { 11 | int item = arr[i]; 12 | 13 | int pos = i; 14 | for (int j = i+1; j 2 | #include 3 | #include 4 | struct node 5 | { 6 | int data; 7 | struct node *left,*right; 8 | }; 9 | typedef struct node Node; 10 | bool first; 11 | // Function to perform In-Order Traversal 12 | void inOrderTraversal(Node* root) { 13 | if (root == NULL) return; 14 | inOrderTraversal(root->left); 15 | if (!first) printf(" -> "); 16 | printf("%d",root->data); 17 | first = false; 18 | inOrderTraversal(root->right); 19 | } 20 | // Function to perform Post-Order Traversal 21 | void postOrderTraversal(Node* root) { 22 | if (root == NULL) return; 23 | postOrderTraversal(root->left); 24 | postOrderTraversal(root->right); 25 | if (!first) printf(" -> "); 26 | printf("%d",root->data); 27 | first = false; 28 | } 29 | 30 | // Function to perform Pre-Order Traversal 31 | void preOrderTraversal(Node* root) { 32 | if (root == NULL) return; 33 | if (!first) printf(" -> "); 34 | printf("%d",root->data); 35 | first = false; 36 | preOrderTraversal(root->left); 37 | preOrderTraversal(root->right); 38 | } 39 | Node * createNode(int data){ 40 | Node *root=malloc(sizeof(Node)); 41 | root->data=data; 42 | root->left=NULL; 43 | root->right=NULL; 44 | } 45 | int main() { 46 | // Creating a sample binary tree 47 | Node* root = createNode(1); 48 | root->left = createNode(12); 49 | root->right = createNode(9); 50 | root->left->left = createNode(5); 51 | root->left->right = createNode(6); 52 | 53 | 54 | first = true; 55 | 56 | printf( "In-Order Traversal: "); 57 | inOrderTraversal(root); 58 | printf("\n"); 59 | 60 | first = true; 61 | printf( "Post-Order Traversal: "); 62 | postOrderTraversal(root); 63 | printf("\n"); 64 | 65 | first = true; 66 | printf( "Pre-Order Traversal: "); 67 | preOrderTraversal(root); 68 | printf("\n"); 69 | 70 | // Clean up: Delete nodes to avoid memory leaks 71 | free(root->left->left); 72 | free(root->left->right); 73 | free(root->left); 74 | free(root->right); 75 | free(root); 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /DSA_Codesheet/Java/Rotated_sorted_array.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class RotatedArraySearch { 4 | public static int searchInRotatedArray(int[] nums, int target) { 5 | int left = 0; 6 | int right = nums.length - 1; 7 | 8 | while (left <= right) { 9 | int mid = left + (right - left) / 2; 10 | 11 | if (nums[mid] == target) { 12 | return mid; 13 | } else if (nums[left] <= nums[mid]) { 14 | if (nums[left] <= target && target < nums[mid]) { 15 | right = mid - 1; 16 | } else { 17 | left = mid + 1; 18 | } 19 | } else { 20 | if (nums[mid] < target && target <= nums[right]) { 21 | left = mid + 1; 22 | } else { 23 | right = mid - 1; 24 | } 25 | } 26 | } 27 | 28 | return -1; 29 | } 30 | 31 | public static void main(String[] args) { 32 | Scanner scanner = new Scanner(System.in); 33 | 34 | // Input: Size of the rotated sorted array 35 | System.out.print("Enter the size of the rotated sorted array: "); 36 | int size = scanner.nextInt(); 37 | 38 | int[] nums = new int[size]; 39 | 40 | // Input: Elements of the rotated sorted array 41 | System.out.print("Enter the elements of the rotated sorted array: "); 42 | for (int i = 0; i < size; i++) { 43 | nums[i] = scanner.nextInt(); 44 | } 45 | 46 | // Input: Target element to search 47 | System.out.print("Enter the target element to search: "); 48 | int target = scanner.nextInt(); 49 | 50 | // Find the index of the target element using the searchInRotatedArray function 51 | int index = searchInRotatedArray(nums, target); 52 | 53 | // Output: Print the result 54 | if (index != -1) { 55 | System.out.println("Element " + target + " found at index " + index); 56 | } else { 57 | System.out.println("Element " + target + " not found in the array"); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DSA_Codesheet/Cpp/MergeSort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void merge(int arr[], int l, int m, int r) { 4 | int n1 = m - l + 1; 5 | int n2 = r - m; 6 | 7 | // Create temporary arrays 8 | int left[n1]; 9 | int right[n2]; 10 | 11 | // Copy data to temporary arrays left[] and right[] 12 | for (int i = 0; i < n1; i++) { 13 | left[i] = arr[l + i]; 14 | } 15 | for (int j = 0; j < n2; j++) { 16 | right[j] = arr[m + 1 + j]; 17 | } 18 | 19 | // Merge the temporary arrays back into arr[l..r] 20 | int i = 0; // Initial index of first subarray 21 | int j = 0; // Initial index of second subarray 22 | int k = l; // Initial index of merged subarray 23 | 24 | while (i < n1 && j < n2) { 25 | if (left[i] <= right[j]) { 26 | arr[k] = left[i]; 27 | i++; 28 | } else { 29 | arr[k] = right[j]; 30 | j++; 31 | } 32 | k++; 33 | } 34 | 35 | // Copy the remaining elements of left[], if any 36 | while (i < n1) { 37 | arr[k] = left[i]; 38 | i++; 39 | k++; 40 | } 41 | 42 | // Copy the remaining elements of right[], if any 43 | while (j < n2) { 44 | arr[k] = right[j]; 45 | j++; 46 | k++; 47 | } 48 | } 49 | 50 | void mergeSort(int arr[], int l, int r) { 51 | if (l < r) { 52 | int m = l + (r - l) / 2; 53 | 54 | // Sort first and second halves 55 | mergeSort(arr, l, m); 56 | mergeSort(arr, m + 1, r); 57 | 58 | // Merge the sorted halves 59 | merge(arr, l, m, r); 60 | } 61 | } 62 | 63 | int main() { 64 | int arr[] = {12, 11, 13, 5, 6, 7}; 65 | int arr_size = sizeof(arr) / sizeof(arr[0]); 66 | 67 | std::cout << "Original array: "; 68 | for (int i = 0; i < arr_size; i++) { 69 | std::cout << arr[i] << " "; 70 | } 71 | std::cout << std::endl; 72 | 73 | // Perform merge sort 74 | mergeSort(arr, 0, arr_size - 1); 75 | 76 | std::cout << "Sorted array: "; 77 | for (int i = 0; i < arr_size; i++) { 78 | std::cout << arr[i] << " "; 79 | } 80 | std::cout << std::endl; 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /DSA_Codesheet/C/Search_Rotated_SortedArray.cpp: -------------------------------------------------------------------------------- 1 | #include // Include the standard input/output library. 2 | 3 | // Function to search for a target element in a rotated and sorted array. 4 | int searchInRotatedSortedArray(int rotatedSortedArray[], int n, int target) { 5 | int low = 0, high = n - 1; // Initialize low and high pointers. 6 | 7 | while (low <= high) { // Perform a binary search in the array. 8 | int mid = (low + high) / 2; // Calculate the middle index of the current search range. 9 | 10 | if (rotatedSortedArray[mid] == target) { // If the middle element is the target, return its index. 11 | return mid; 12 | } 13 | 14 | if (rotatedSortedArray[low] <= rotatedSortedArray[mid]) { 15 | // If the left half is sorted (no rotation in this part): 16 | if (rotatedSortedArray[low] <= target && target < rotatedSortedArray[mid]) { 17 | high = mid - 1; // Adjust the high pointer to search in the left half. 18 | } else { 19 | low = mid + 1; // Adjust the low pointer to search in the right half. 20 | } 21 | } else { 22 | // If the right half is sorted (no rotation in this part): 23 | if (rotatedSortedArray[mid] < target && target <= rotatedSortedArray[high]) { 24 | low = mid + 1; // Adjust the low pointer to search in the right half. 25 | } else { 26 | high = mid - 1; // Adjust the high pointer to search in the left half. 27 | } 28 | } 29 | } 30 | 31 | return -1; // If the target element is not found, return -1. 32 | } 33 | 34 | int main() { 35 | printf("Enter the size of the array: "); 36 | int n; 37 | scanf("%d", &n); // Read the size of the array from the user. 38 | 39 | int rotatedSortedArray[n]; 40 | printf("Enter the elements of the rotated sorted array: "); 41 | for (int i = 0; i < n; ++i) { 42 | scanf("%d", &rotatedSortedArray[i]); // Read each element from the user and store it in the array. 43 | } 44 | 45 | int target; 46 | printf("Enter the target element to search: "); 47 | scanf("%d", &target); // Read the target element from the user. 48 | 49 | int result = searchInRotatedSortedArray(rotatedSortedArray, n, target); // Call the search function. 50 | 51 | if (result != -1) { 52 | printf("Element %d found at index %d\n", target, result); // Output the result if the target is found. 53 | } else { 54 | printf("Element %d not found in the array\n", target); // Output a message if the target is not found. 55 | } 56 | 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. 2 | 3 | If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". 4 | Don't forget to give the project a star! Thanks again! 5 | 6 | 7 | ## How to Contribute 8 | 9 | We're looking for DSA enthusiasts to contribute to this repository by creating and solving DSA worksheets. Here's how you can get involved: 10 | 11 | 1. **Fork this repository:** Click the "Fork" button on the top right to create your own copy. 12 | 13 | 2. **Clone your fork:** Use `git clone` to clone your fork to your local machine: 14 | 15 | ```sh 16 | git clone 17 | ``` 18 | 19 | 3. **Create a new branch:** Make a new branch for your worksheet: 20 | 21 | ```sh 22 | git checkout -b your_name-dsa-worksheet 23 | ``` 24 | 25 | 4. **Add your worksheet:** Create a new file in the folder of your selected programming language and add your DSA problem. 26 | 27 | 5. **Commit your changes:** Once you've added your worksheet, commit your changes: 28 | 29 | ```sh 30 | git commit -m "Add my awesome DSA worksheet" 31 | ``` 32 | 33 | 6. **Push to your fork:** Push your changes to your GitHub fork: 34 | 35 | ```sh 36 | git push origin your_name-dsa-worksheet 37 | ``` 38 | 39 | 7. **Create a Pull Request (PR):** Head to the original repository on GitHub and create a new PR. Our maintainers will review your PR and provide feedback. 40 | 41 | 8. **Star this Repository.** 42 | 43 | ## Video Tutorial 44 | 45 | https://github.com/lilmistake/DSA_Worksheet/assets/61899816/99c98fbb-0d9d-47dc-84d6-9246864d5dcd 46 | 47 | ## Guidelines for Contributions 48 | 49 | - Please ensure that your DSA solution is clear and well-documented. 50 | - Create a separate folder for your solution in the "DSA_Codesheet" directory and place your worksheet file there. 51 | - In the "DSA_Codesheet" directory there are multiple directories for certain coding languages. 52 | - Make sure you submit your code in the correct language directory. 53 | - Feel free to create multiple solutions in your PR. 54 | - Make sure your code is clean, follows best practices, and is properly formatted. 55 | - Finally, add your name in the contributors in "README.md" 56 | 57 | ## Add your name in the Contributors 58 | 59 | 1. Edit the `README.md` file using any text editor, VScode for example. 60 | 61 | 2. Below is a code snippet for reference as to what has to ADDED in the file. Inside the ` ` tag you have to put your name, in the `` tag, you have to place your github profile URL. And lastly you have to place your github profile photo url inside the `src` tag. 62 | 63 | ``` 64 | 65 | 66 | your_name 67 |
68 | your_name 69 |
70 | 71 | ``` 72 | 73 | 3. Now save your changes 74 | 75 | 76 | ## Create Problem Statements 77 | If you have a problem statement that you wish to add to this repository, feel free to do so by creating an issue. There is already a template made for DSA Questions named DSA Questions Template, follow these steps to create an issue: 78 | - Click on Issues 79 | - Click on New Issues 80 | - Click "Get Started" on DSA Question Template 81 | - Make necessary changes 82 | - Submit the issue. 83 | If you want to make a new issue from scratch then make sure you follow the underwritten guidelines: 84 | 1. __Title Format__: The title should be concise and give a hint about the nature of the problem. 85 | 2. __Problem Description__: copy the raw code of the [issue template](https://github.com/Chitresh-code/DSA_Worksheet/blob/main/.github/ISSUE_TEMPLATE/dsa-question-template.md) and paste it in the issue description and add the additional requirements. 86 | 3. __Tags/Labels:__ Add relevant tags or labels to help categorize the problem. Every problem must have labels for programming language (Python, C, C++, Java) as well as 1 label for difficulty level (`Level: Easy`, `Level: Medium`, `Level: Hard`). To make the problem elegible for Hacktoberfest, add the `hacktoberfest-2023` label as well. 87 | 4. __General Rules__: 88 | 89 | 1. __Uniqueness__: Before creating an issue, please search the existing issues to avoid duplicates. 90 | 91 | 2. __Clarity__: Ensure the problem statement is clear. Ambiguous problem statements can confuse contributors. 92 | 3. __Stay Updated__: If someone asks a question or needs clarification on your issue, try to respond promptly. 93 | 4. __Constructive Feedback__: If you're referencing a problem from another platform or book, ensure you're not violating any copyright rules. Always give credit where it's due. 94 | 5. __No Spoilers__: If you're also providing a solution, please don't post it directly in the issue. We want to give others a chance to solve it. Instead, consider creating a pull request with the solution, or linking to a separate solution discussion. 95 | 96 | Note that any issue that doesn't abide by this guideline will be closed immediately. 97 | ## Getting Help 98 | 99 | If you have any questions or need assistance, feel free to open an issue or reach out to our community in the discussion section. 100 | 101 | We're excited to see your contributions and help you in your DSA journey. Happy Hacking! 102 | 103 | ## License 104 | 105 | This repository is open-source and available under the [MIT License](https://github.com/Chitresh-code/DSA_Worksheet/blob/main/LICENSE). 106 | ``` 107 | 108 | Feel free to customize this README to suit your repository's specific requirements. Be sure to include clear guidelines for contributions, information about how to participate in Hacktoberfest, and any other details that are relevant to your project. 109 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hacktoberfest 2023 DSA Worksheet Repository 2 | 3 | 4 | 5 | [![STARS](https://img.shields.io/github/stars/Chitresh-code/DSA_Worksheet.svg)](https://github.com/Chitresh-code/DSA_Worksheet/stargazers) 6 | [![ISSUES](https://img.shields.io/github/issues/Chitresh-code/DSA_Worksheet.svg)](https://github.com/Chitresh-code/DSA_Worksheet/issues) 7 | [![CONTRIBUTORS](https://img.shields.io/github/contributors/Chitresh-code/DSA_Worksheet.svg)](https://github.com/Chitresh-code/DSA_Worksheet/graphs/contributors) 8 | ![FORKS](https://img.shields.io/github/forks/Chitresh-code/DSA_Worksheet?color=blue) 9 | ![Merged Pull Requests](https://img.shields.io/github/issues-pr-closed/Chitresh-code/DSA_Worksheet?color=success) 10 | ![Active Pull Requests](https://img.shields.io/github/issues-pr/Chitresh-code/DSA_Worksheet?color=blue) 11 | 12 | 13 | ## Introduction 14 | Welcome to the Hacktoberfest 2023 DSA Worksheet Repository! This is a collaborative space for students and developers to practice and contribute to Data Structures and Algorithms (DSA) problems. 15 | 16 | ## What is Hacktoberfest? 17 | 18 | Hacktoberfest is an annual event encouraging open-source contributions. By participating, you can earn cool swag and gain experience in working with real-world projects on GitHub. 19 | 20 | For more information about Hacktoberfest, please visit the official website: [Hacktoberfest 2023](https://hacktoberfest.digitalocean.com/) 21 | 22 | 23 | ## Features 24 | - Here we upload issues on DSA problems and Algorithms everyday. 25 | - You can choose the language you want to contribute in. 26 | - The languages include C, Cpp, Java and Python. 27 | - You can fork this repository and merge your PR's. 28 | - With this we aim to let students practice and solve DSA questions everyday. 29 | - And students will also improve their GitHub profiles with more pull requests. 30 | 31 | 32 | ## Make Contribution 33 | 34 | Follow the below link to redirect you to the guide on how to make a successful contribution. 35 |
36 | [CONTRIBUTING.md](https://github.com/Chitresh-code/DSA_Worksheet/blob/main/CONTRIBUTING.md) 37 | 38 | ## Create your own Issue 39 | 40 | If you wish to create an issue follow the below link and click on DSA Question Template. 41 |
42 | [Create Issue!](https://github.com/Chitresh-code/DSA_Worksheet/issues/new/choose) 43 | 44 | ## Code Of Conduct 45 | 46 | Please follow the Code of Conduct. 47 | Click Here [CODE_OF_CONDUCT](https://www.contributor-covenant.org/) 48 | 49 | 50 | 51 | 52 | 53 | 54 | ## License 55 | 56 | Distributed under the MIT License. See `LICENSE` for more information. 57 | 58 | ## Contributors 59 | 60 | 61 | 62 | 63 | 70 | 77 | 84 | 91 | 98 | 105 | 106 | 113 | 120 | 127 | 134 | 141 | 148 | 149 | 156 | 163 | 170 | 177 | 184 | 191 |
64 | 65 | lilmistake 66 |
67 | Rohit 68 |
69 |
71 | 72 | Chitresh-code 73 |
74 | Chitresh Gyanani 75 |
76 |
78 | 79 | yanurag1414 80 |
81 | ANURAG YADAV 82 |
83 |
85 | 86 | prabhat224 87 |
88 | Prabhat Dwivedi 89 |
90 |
92 | 93 | its-amans 94 |
95 | Null 96 |
97 |
99 | 100 | gitaditee 101 |
102 | Aditee 103 |
104 |
107 | 108 | Somil-Shukla 109 |
110 | Null 111 |
112 |
114 | 115 | Raj-sharma01 116 |
117 | Raj Sharma 118 |
119 |
121 | 122 | AdityaDKale 123 |
124 | Aditya Kale 125 |
126 |
128 | 129 | Nikita06211 130 |
131 | Null 132 |
133 |
135 | 136 | vidip21 137 |
138 | Null 139 |
140 |
142 | 143 | awsmdeep 144 |
145 | DEEPAK KUMAR DAS 146 |
147 |
150 | 151 | BEAST-PRINCE 152 |
153 | DIVYANSHU PRINCE 154 |
155 |
157 | 158 | Faraaz22 159 |
160 | FARAAZ MAHMOOD 161 |
162 |
164 | 165 | NikeshGangwar41 166 |
167 | Nikesh Gangwar 168 |
169 |
171 | 172 | UdaySagar-Git 173 |
174 | Uday Sagar 175 |
176 |
178 | 179 | yashashwini16 180 |
181 | Yashaswini B 182 |
183 |
185 | 186 | DebidYadav 187 |
188 | Debid Yadav 189 |
190 |
192 | --------------------------------------------------------------------------------