Java Program to Generate All Possible Subsets using Lexicographic Order

This is a java program to generate and print all the subsets of a given set as per lexicographical order, here we follow the numerical sequence. First generate all the subsets having only one element, then generate all the subsets having two elements and so on. Here is the source code of the Java Program … Read more

advertisement

Java Program to Find kth Smallest Element in Array using Partitioning

This is a java program to find kth smallest element form the given sequence of numbers. This could be solved by using Quick sort algorithm, where we partition around the pivot element, the entire sequence of numbers is broken down to two, we arrange the number such that numbers smaller than pivot is kept in … Read more

advertisement

Java Program to Generate All Possible Subsets with Exactly k Elements in Each Subset

This is a java program to generate and print all subsets containing exactly k element, where k is provided by user and is

advertisement

Java Program to Perform Integer Partition for a Specific Case

This is a java program to generate and print all the partitions of a number such that when those partition elements are added results in the number itself, plus the partition should be unique. We start with the number, number minus one is the next partition and so on, till all one’s are the last … Read more

advertisement

Java Program to Generate All Possible Subsets using Gray Code Order

This is a java program to generate and print all the subsets using the Gray Code Order. The reflected binary code, also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only one bit (binary digit). The gray code equivalent of a binary number is (number … Read more

advertisement

Java Program to Generate All Possible Subsets using Binary Counting Method

This is a java program to generate and print all possible subsets using the method of Binary Counting method. The generations of subsets are done using binary numbers. Let there be 3 elements in the set, we generate binary equivalent of 2^3 = 8 numbers(0-7), where each bit in a number represents the presence/absence of … Read more

advertisement

Java Program to Compute Combinations using Recurrence Relation for nCr

This is a java program to generate and print all possible combinations out of a, b, c, d, e. The trick here is to start with one letter combinations, then with two letter combinations and so on. Here is the source code of the Java Program to Generate All Possible Combinations Out of a, b, … Read more

advertisement

Java Program to Find the Maximum Subarray Sum using Naive Method

This is a Java Program to find maximum subarray sum of an array. A subarray is a continuous portion of an array. The time complexity of the following program is O (n2). Here is the source code of the Java program to find maximum subarray sum. The Java program is successfully compiled and run on … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.