Menu Close

Tag: java

Help Mommy out …fcukthecode

Mommy is a very active lady. She likes to keep all stuff sorted. She has developed an interesting technique of sorting stuff over the years.…

Bubble Sort… – FcukTheCode

Parameter Description Stable Yes In place Yes Best case complexity O(n) Average case complexity O(n^2) Worst case complexity O(1) The BubbleSort compares each successive pair…

Sorting – fcukthecode

Parameter Description Stability A sorting algorithm is stable if it preserves the relative order of equal elements after sorting. In place A sorting algorithm is…

Java program to create a Triangle …ftc

Java program to create a Triangle. INPUT_1:Enter any number:  5 OUTPUT:*************** INPUT_2:Enter any number:  4 OUTPUT:********** INPUT_3:Enter any number:  2 OUTPUT:*** INPUT_4:Enter any number:  10…

Harmonic Number in Java …ftc

Print the sum of nth harmonic number: 1/1 + 1/2 + … + 1/n. Note: Use Double Data type and String.format(“%.02f”, variable name) INPUT_1:Enter nth…

Number Pattern 111111 in Java …ftc

Write a program to print following outputs. 1111111111112211113331114444115555516666667777777 INPUT_1:Enter any number:  7 OUTPUT:1111111111112211113331114444115555516666667777777 INPUT_2:Enter any number:  5 OUTPUT:1111111122113331444455555 INPUT_3:Enter any number:  6 OUTPUT:111111111122111333114444155555666666 INPUT_4:Enter any…

Conversion from binary to decimal in Java …ftc

Java Program to convert from binary to decimal number. INPUT_1:Binary:  1101 OUTPUT:Decimal:  13 INPUT_2:Binary:  111 OUTPUT:Decimal:  7 INPUT_3:Binary:  001 OUTPUT:Decimal:  1 INPUT_4:Binary:  1111 OUTPUT:Decimal:  15…