{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":737369555,"defaultBranch":"main","name":"Java","ownerLogin":"Sasanka14","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-12-30T19:30:30.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/145803169?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1703964633.0","currentOid":""},"activityList":{"items":[{"before":"5f53ea94805e30c88f3f388650b3577ccecb7c5f","after":"5db72c551cd15371595ad56c78a59849000d574a","ref":"refs/heads/main","pushedAt":"2024-07-18T08:41:13.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The code demonstrates the creation and display of a 4x4 2D array, where each element is sequentially assigned values from 1 to 16, and includes a separate function to search for a user-inputted value within the array, printing the position if found or notifying if the value is not present.","shortMessageHtmlLink":"Summary of the code:: The code demonstrates the creation and display …"}},{"before":"9363143233db6537fa11733a3db3f660c053be53","after":"5f53ea94805e30c88f3f388650b3577ccecb7c5f","ref":"refs/heads/main","pushedAt":"2024-07-17T14:23:03.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Java sorting algorithm implementations.","shortMessageHtmlLink":"Java sorting algorithm implementations."}},{"before":"77b2747dae898f7cb9b42c8bd52f3d57970b1e36","after":"9363143233db6537fa11733a3db3f660c053be53","ref":"refs/heads/main","pushedAt":"2024-07-17T14:15:14.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: This Java program allows the user to input an array and then choose one of five sorting algorithms to sort the array in descending order: Bubble Sort, Selection Sort, Insertion Sort, Counting Sort, or Java's built-in sort. The program defines methods for each sorting algorithm and prompts the user to choose which method to apply. Based on the user's choice, the corresponding sorting method is executed, and the sorted array is printed. If the user does not choose a valid option, the program defaults to using Java's built-in sort in descending order by converting the array to an `Integer[]` type, sorting it with `Collections.reverseOrder()`, and then converting it back to `int[]` before printing the result.","shortMessageHtmlLink":"Summary of the code:: This Java program allows the user to input an a…"}},{"before":"1dbea32d92bc20243fd4f9b256dce450552614f6","after":"77b2747dae898f7cb9b42c8bd52f3d57970b1e36","ref":"refs/heads/main","pushedAt":"2024-07-17T11:53:54.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program implements the Counting Sort algorithm to sort an array of integers. It begins by reading the number of elements and the array elements from the user. The algorithm first identifies the maximum and minimum values in the array to determine the range of values. It then uses a counting array to count occurrences of each element relative to the minimum value. After computing cumulative counts in the counting array, it builds the sorted output array based on these counts, placing each element in its correct position. Finally, the sorted elements are copied back to the original array and printed to the console. This implementation ensures efficient sorting with a time complexity of \\( O(n + \\text{range}) \\), where \\( n \\) is the number of elements and \\( \\text{range} \\) is the difference between the maximum and minimum values in the input array.","shortMessageHtmlLink":"Summary of the Code:: This Java program implements the Counting Sort …"}},{"before":"19ceccb59a110a40cacff87606b93be688512f9e","after":"1dbea32d92bc20243fd4f9b256dce450552614f6","ref":"refs/heads/main","pushedAt":"2024-07-17T10:45:27.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The provided code is a Java program that sorts an array of integers using Java's built-in `Arrays.sort()` method and then prints the sorted array in both ascending and descending order. It utilizes the `Scanner` class to take user input for the number of elements and the elements themselves. The `builtInSort` method sorts the array in ascending order, while the `printReverse` method reverses and prints the sorted array using the `Collections.reverse()` method on a `List` created from the array. The main method orchestrates the input, sorting, and output processes, ensuring a clear flow from data input to final display.","shortMessageHtmlLink":"Summary of the code:: The provided code is a Java program that sorts …"}},{"before":"05830ae5c7349b455384dac68002bfce701f71b9","after":"19ceccb59a110a40cacff87606b93be688512f9e","ref":"refs/heads/main","pushedAt":"2024-07-17T09:27:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The provided code is a Java program that sorts an array of integers using Java's built-in `Arrays.sort()` method and then prints the sorted array in both ascending and descending order. It utilizes the `Scanner` class to take user input for the number of elements and the elements themselves. The `builtInSort` method sorts the array in ascending order, while the `printReverse` method reverses and prints the sorted array using the `Collections.reverse()` method on a `List` created from the array. The main method orchestrates the input, sorting, and output processes, ensuring a clear flow from data input to final display.","shortMessageHtmlLink":"Summary of the code:: The provided code is a Java program that sorts …"}},{"before":"891bd4a9347bbc1d61eee009448fa79868674224","after":"05830ae5c7349b455384dac68002bfce701f71b9","ref":"refs/heads/main","pushedAt":"2024-07-16T15:46:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: This Java program demonstrates the Insertion Sort algorithm. The `insertionSort` method sorts an integer array by iterating through the array and inserting each element into its correct position within the sorted portion of the array. The `main` method handles user input, prompting the user to enter the number of elements and the elements themselves, stores them in an array, calls the `insertionSort` method to sort the array, and then prints the sorted array. The program uses a Scanner for input and includes logic to shift array elements to make room for inserting the current element into its proper position.","shortMessageHtmlLink":"Summary of the code:: This Java program demonstrates the Insertion So…"}},{"before":"c1cfd3c473e58fdb2d08d957d6d3744cb788070a","after":"891bd4a9347bbc1d61eee009448fa79868674224","ref":"refs/heads/main","pushedAt":"2024-07-16T15:31:17.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: This Java program implements the Selection Sort algorithm to sort an array of integers. The `selectionSort` method iterates over the array, repeatedly finding the minimum element from the unsorted portion and swapping it with the first unsorted element, thus expanding the sorted portion of the array step by step. The `main` method prompts the user to input the number of elements and the elements themselves, then calls `selectionSort` to sort the array, and finally prints the sorted array. The program makes use of a `Scanner` for user input and demonstrates the sorting process with a clear and concise implementation.","shortMessageHtmlLink":"Summary of the code:: This Java program implements the Selection Sort…"}},{"before":"94026c0e14c4ff5bb0a082ff694dd670876bc25c","after":"c1cfd3c473e58fdb2d08d957d6d3744cb788070a","ref":"refs/heads/main","pushedAt":"2024-07-16T15:07:18.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The provided code implements the Bubble Sort algorithm in Java, which sorts an array of integers in ascending order. It takes input from the user for the number of elements and the elements themselves, then sorts the array using Bubble Sort. This sorting algorithm repeatedly compares and swaps adjacent elements if they are in the wrong order, with an optimization to terminate early if no swaps are made during a pass, indicating that the array is already sorted. Finally, the sorted array is printed.","shortMessageHtmlLink":"Summary of the code:: The provided code implements the Bubble Sort al…"}},{"before":"15080d77b3ade38f7a9b199d575e6c8e81d1ca4b","after":"94026c0e14c4ff5bb0a082ff694dd670876bc25c","ref":"refs/heads/main","pushedAt":"2024-07-16T13:50:48.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The provided code implements the Bubble Sort algorithm in Java, which sorts an array of integers in ascending order. It takes input from the user for the number of elements and the elements themselves, then sorts the array using Bubble Sort. This sorting algorithm repeatedly compares and swaps adjacent elements if they are in the wrong order, with an optimization to terminate early if no swaps are made during a pass, indicating that the array is already sorted. Finally, the sorted array is printed.","shortMessageHtmlLink":"Summary of the code:: The provided code implements the Bubble Sort al…"}},{"before":"7639fb1d2f65a1a10061da0e46c94399dbe4431c","after":"15080d77b3ade38f7a9b199d575e6c8e81d1ca4b","ref":"refs/heads/main","pushedAt":"2024-07-13T16:00:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Advanced Java array operations and algorithms.","shortMessageHtmlLink":"Advanced Java array operations and algorithms."}},{"before":"35b812782ae62da95b5a99a8136adcf234ee7d01","after":"7639fb1d2f65a1a10061da0e46c94399dbe4431c","ref":"refs/heads/main","pushedAt":"2024-07-13T15:57:57.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: To solve this problem, we can use a modified binary search algorithm. The key idea is to identify which part of the array (left or right) is sorted, and then determine if the target is in the sorted part.","shortMessageHtmlLink":"Summary of the code:: To solve this problem, we can use a modified bi…"}},{"before":"5f7c86924e525cac97d70164b6ac6e1fbb3d8183","after":"35b812782ae62da95b5a99a8136adcf234ee7d01","ref":"refs/heads/main","pushedAt":"2024-07-13T15:54:39.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The provided Java code defines a class `ProblemQuestion5` with a method `threeSum` that finds all unique triplets in an integer array `nums` that sum to zero. The `threeSum` method sorts the array, then uses a combination of a loop and two-pointer technique to identify valid triplets, ensuring no duplicates are included in the result. The `main` method accepts user input for the number of elements and the elements themselves, calls `threeSum` to find the triplets, and prints the results. The program makes extensive use of the `java.util` package, including `ArrayList`, `Arrays`, `List`, and `Scanner`.","shortMessageHtmlLink":"Summary of the code:: The provided Java code defines a class `Problem…"}},{"before":"c4f81a76f5663cc7c810f53859fb8b33f5fecfe5","after":"5f7c86924e525cac97d70164b6ac6e1fbb3d8183","ref":"refs/heads/main","pushedAt":"2024-07-12T19:53:53.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: To solve the problem of calculating how much water can be trapped between the bars of a given elevation map, we can use the \"two-pointer\" approach. This approach efficiently calculates the trapped water in O(n) time complexity and O(1) space complexity.","shortMessageHtmlLink":"Summary of the code:: To solve the problem of calculating how much wa…"}},{"before":"0d15d082341365b32e949cdc90a72c04419de349","after":"c4f81a76f5663cc7c810f53859fb8b33f5fecfe5","ref":"refs/heads/main","pushedAt":"2024-07-12T19:48:20.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: To solve this problem, we need to find the maximum profit that can be achieved by buying and selling a stock on different days. The key is to buy at the lowest price and sell at the highest price after the buying day.","shortMessageHtmlLink":"Summary of the code:: To solve this problem, we need to find the maxi…"}},{"before":"2645dd88be559ed95a611b28bb704a59354a7b9b","after":"0d15d082341365b32e949cdc90a72c04419de349","ref":"refs/heads/main","pushedAt":"2024-07-12T19:38:11.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: To determine if any value appears at least twice in an array, you can use a HashSet to track the elements you have seen so far. As you iterate through the array, if you encounter an element that is already in the HashSet, it means the element appears at least twice, and you can return true. If you finish iterating through the array without finding any duplicates, you can return false.","shortMessageHtmlLink":"Summary of the code:: To determine if any value appears at least twic…"}},{"before":"2ffddd015ed48f0ab2d09b67e804973d50a2f7c1","after":"2645dd88be559ed95a611b28bb704a59354a7b9b","ref":"refs/heads/main","pushedAt":"2024-07-12T15:30:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: The Java program \"BuyAndSellStock\" calculates the maximum profit that can be achieved by buying and selling a stock given its prices over a number of days. It uses a straightforward approach where it iterates through the prices array, keeping track of the minimum price encountered so far (`minPrice`) and updating the maximum profit (`maxProfit`) whenever a higher profit is found by selling at the current price minus the minimum price. The program takes user inputs for the number of days and the stock prices, computes the maximum profit using these prices, and outputs the result.","shortMessageHtmlLink":"Summary of the code:: The Java program \"BuyAndSellStock\" calculates t…"}},{"before":"5463cd3dc942a1fa10ed27e92a82cdb020dfceaf","after":"2ffddd015ed48f0ab2d09b67e804973d50a2f7c1","ref":"refs/heads/main","pushedAt":"2024-07-12T13:48:25.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program calculates the total rainwater trapped between bars of varying heights using auxiliary arrays. It includes the `trapRainwater` function, which takes an array of bar heights, uses `left_max` and `right_max` arrays to store the maximum heights to the left and right of each bar, and computes the trapped water by summing the minimum of `left_max` and `right_max` for each bar minus the bar's height. The `main` function takes user input for the number of bars and their heights, calls the `trapRainwater` function to calculate the total trapped rainwater, and prints the result. This method efficiently computes trapped rainwater by preprocessing the maximum heights on both sides of each bar, enabling linear time computation.","shortMessageHtmlLink":"Summary of the Code:: This Java program calculates the total rainwate…"}},{"before":"79c7a4a1c4ee2bcea7b7549ea5d3fd5d6c12a30a","after":"5463cd3dc942a1fa10ed27e92a82cdb020dfceaf","ref":"refs/heads/main","pushedAt":"2024-07-11T15:16:34.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program demonstrates the implementation of Kadane's Algorithm to find the maximum subarray sum in a given array. The user inputs the number of elements and the elements of the array. The maxSubarraySum function processes the array in a single pass to compute the maximum subarray sum by maintaining two variables: maxCurrent for the current maximum sum and maxGlobal for the global maximum sum. The final result is printed, showing the maximum subarray sum. The time complexity of this algorithm is O(n) and the space complexity is O(1).","shortMessageHtmlLink":"Summary of the Code:: This Java program demonstrates the implementati…"}},{"before":"990d5610e8fc04b1457c37c088a66e4554df36a5","after":"79c7a4a1c4ee2bcea7b7549ea5d3fd5d6c12a30a","ref":"refs/heads/main","pushedAt":"2024-07-09T19:16:59.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program calculates the maximum subarray sum using the prefix array approach. The user is prompted to input the number of elements in the array and then the elements themselves. The program creates a prefix array where each element at index i contains the sum of the array elements from the start to the i-th index. Using this prefix array, the program efficiently calculates the sum of all possible subarrays by subtracting the prefix sums and keeps track of the maximum sum encountered. Finally, it outputs the maximum subarray sum found. This method optimizes the subarray sum calculation, reducing the time complexity compared to the brute force approach.","shortMessageHtmlLink":"Summary of the Code:: This Java program calculates the maximum subarr…"}},{"before":"2a8e7e8c585e5980a96bbdf076d11a2cf11e7867","after":"990d5610e8fc04b1457c37c088a66e4554df36a5","ref":"refs/heads/main","pushedAt":"2024-07-09T18:59:58.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: This Java program calculates the maximum subarray sum using a brute force approach. It prompts the user to input the number of elements in the array and then the elements themselves. The `maxSubarraySum` function iterates through all possible subarrays, calculates their sums, and prints each subarray sum along with its starting and ending indices. The function also keeps track of the maximum subarray sum encountered. Finally, the program outputs the maximum subarray sum. The use of nested loops ensures that every possible subarray is considered, making the method exhaustive but not the most efficient.","shortMessageHtmlLink":"Summary of the code:: This Java program calculates the maximum subarr…"}},{"before":"881156145b47f5afd6b47c9a54b2e8ae78798338","after":"2a8e7e8c585e5980a96bbdf076d11a2cf11e7867","ref":"refs/heads/main","pushedAt":"2024-07-09T15:10:03.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the code:: This Java program calculates the maximum subarray sum using a brute force approach. It prompts the user to input the number of elements in the array and then the elements themselves. The `maxSubarraySum` function iterates through all possible subarrays, calculates their sums, and prints each subarray sum along with its starting and ending indices. The function also keeps track of the maximum subarray sum encountered. Finally, the program outputs the maximum subarray sum. The use of nested loops ensures that every possible subarray is considered, making the method exhaustive but not the most efficient.","shortMessageHtmlLink":"Summary of the code:: This Java program calculates the maximum subarr…"}},{"before":"57ce15d849fa3f6491a33b7a3a28a62a9a527a4e","after":"881156145b47f5afd6b47c9a54b2e8ae78798338","ref":"refs/heads/main","pushedAt":"2024-07-07T14:33:19.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Comprehensive Java Array Operations","shortMessageHtmlLink":"Comprehensive Java Array Operations"}},{"before":"85d7ee83ce410102c4cc36b959934f08e9a428c7","after":"57ce15d849fa3f6491a33b7a3a28a62a9a527a4e","ref":"refs/heads/main","pushedAt":"2024-07-07T14:19:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program reads an array of integers from the user and prints all possible subarrays. The printSubarrays function uses nested loops to generate subarrays, and a counter is used to keep track of the total number of subarrays. Each subarray is printed line by line, and the total count of subarrays is displayed at the end. User input for the number of elements and the elements themselves is handled using the Scanner class.","shortMessageHtmlLink":"Summary of the Code:: This Java program reads an array of integers fr…"}},{"before":"326d783872b0e6564bdaeaa000f9410200a852ac","after":"85d7ee83ce410102c4cc36b959934f08e9a428c7","ref":"refs/heads/main","pushedAt":"2024-07-07T14:09:50.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program reads an array of integers from the user and prints all possible subarrays of the array. The printSubarrays function uses nested loops to generate subarrays, where the outer loop defines the starting point and the inner loop defines the endpoint of each subarray. Each subarray is printed line by line. User input for the number of elements and the elements themselves is handled using the Scanner class.","shortMessageHtmlLink":"Summary of the Code:: This Java program reads an array of integers fr…"}},{"before":"a1bdf5be7dbc0206f92e748dcce58473178eab56","after":"326d783872b0e6564bdaeaa000f9410200a852ac","ref":"refs/heads/main","pushedAt":"2024-07-07T14:02:21.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program reads an array of integers from the user, prints all unique pairs of elements in the array in a specified format, and calculates the total number of pairs. The printPairs function generates and prints pairs using nested loops and also counts the number of pairs. The program then prints the total count of pairs. User input for the number of elements and the elements themselves is handled using the Scanner class.","shortMessageHtmlLink":"Summary of the Code:: This Java program reads an array of integers fr…"}},{"before":"f6220faf9ec1e795ba6b041c5fdca07a070f53d8","after":"a1bdf5be7dbc0206f92e748dcce58473178eab56","ref":"refs/heads/main","pushedAt":"2024-07-07T13:43:27.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: The program prompts the user to input the size of the array and its elements, prints the original array, and then reverses the array using the `reverseArray` function, which swaps elements from both ends until reaching the middle, before printing the reversed array. The space complexity of this function is \\(O(1)\\) because it only uses a fixed number of extra variables, making it efficient in terms of additional space usage.","shortMessageHtmlLink":"Summary of the Code:: The program prompts the user to input the size …"}},{"before":"d5e0291cfbac67b8ce5d1a862748cc37168b1d67","after":"f6220faf9ec1e795ba6b041c5fdca07a070f53d8","ref":"refs/heads/main","pushedAt":"2024-07-07T04:35:58.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This program uses a predefined, larger sorted array of strings representing various fruits. The user inputs a string element to search for in the array. The `binarySearch` function performs a binary search on the string array, comparing strings using `compareTo`, and returns the index of the key if found, or -1 if not found. The result of the binary search is printed: if the element is found, it prints \"Yes, it is present at index: \" followed by the index; if not, it prints \"Element not found in the array.\"","shortMessageHtmlLink":"Summary of the Code:: This program uses a predefined, larger sorted a…"}},{"before":"82850761335744f7485c48b81fd0a50dd025a6c7","after":"d5e0291cfbac67b8ce5d1a862748cc37168b1d67","ref":"refs/heads/main","pushedAt":"2024-07-07T04:05:51.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This program uses a predefined, larger sorted array of strings representing various fruits. The user inputs a string element to search for in the array. The `binarySearch` function performs a binary search on the string array, comparing strings using `compareTo`, and returns the index of the key if found, or -1 if not found. The result of the binary search is printed: if the element is found, it prints \"Yes, it is present at index: \" followed by the index; if not, it prints \"Element not found in the array.\"","shortMessageHtmlLink":"Summary of the Code:: This program uses a predefined, larger sorted a…"}},{"before":"11b140f78230c8f17c1a730cbc57a54c00a38625","after":"82850761335744f7485c48b81fd0a50dd025a6c7","ref":"refs/heads/main","pushedAt":"2024-07-07T03:53:16.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Sasanka14","name":"Sasanka Sekhar Kundu","path":"/Sasanka14","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/145803169?s=80&v=4"},"commit":{"message":"Summary of the Code:: This Java program finds the smallest number in a given array. The user is prompted to input the number of elements in the array and then the elements themselves. The program iterates through the array to determine the smallest element by comparing each element with a variable initially set to the first element of the array. If a smaller element is found, the variable is updated. Finally, the smallest number is printed as output.","shortMessageHtmlLink":"Summary of the Code:: This Java program finds the smallest number in …"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEgqywaAA","startCursor":null,"endCursor":null}},"title":"Activity · Sasanka14/Java"}