## Coins and Triangle in Java …FTC

Chef belongs to a very rich family which owns many gold mines. Today, he brought N gold coins and decided to form a triangle using…Read More »Coins and Triangle in Java …FTC

Chef belongs to a very rich family which owns many gold mines. Today, he brought N gold coins and decided to form a triangle using…Read More »Coins and Triangle in Java …FTC

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.…Read More »Help Mommy out …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…Read More »Bubble Sort… – 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…Read More »Sorting – fcukthecode

Calculate the number of occurrences of the given input digit in the given numbers. InputThe first line of input consists of a single integer T,…Read More »Occurrences of the Given Digit in Java …fcukthecode

Kostya likes the number 4 much. Of course! This number has such a lot of properties, like: Four is the smallest composite number; It is…Read More »Occurrences of the digit 4 Java .. – FTC

Huffman Coding -: Greedy Algorithms 👇 👇 🙂Link –> HUFFMAN CODING Given a money system, is it possible to give an amount of coins and…Read More »Huffman Coding : Change-making problem ..:- fcukthecode

Huffman Coding -: Greedy Algorithms 👇 👇 🙂Link –> HUFFMAN CODING The ProblemYou have a set of things to do (activities). Each activity has a…Read More »Huffman Coding – Activity Selection Problem

Write a Java program to add two binary numbers. INPUT_1:Enter the Binary 1: 010Enter the Binary 2: 011 OUTPUT:Addition of the two binary number is …Read More »Binary Addition in Java …fcukthecode

Sort the given set of numbers using Selection Sort. The first line of the input contains the number of elements, The second line of the…Read More »Selection Sorting in Java …fcukthecode

Write a Java Program to Calculate the average value of array element.Refer the testcases INPUT_1:Enter n number: 4Enter n arrays: 34 89 100 78 OUTPUT:Average…Read More »Average value of array element [Java] …ftc

Huffman Coding – Activity Selection Problem👉 👉 Activity Selection Problem Huﬀman code is a particular type of optimal preﬁx code that is commonly used for…Read More »Huffman Coding -: Greedy Algorithms …FTC

Alert: Watch the Anime “Sword Art Online” and the film “Ready Player one” before reading this. Metaverse is the Future. Have anyone seen Sword Art…Read More »Metaverse – It is/will be the future …FTC

Write a java Java program to check whether one string is rotation of another string. INPUT_1:String s1: string1234String s2: 1234string OUTPUT:s2 is a rotated version…Read More »Match string with rotated string in java …ftc

Given a string, Write an efficient java method to return maximum occurring character in the input string E.g., if input string is “test” then function…Read More »Maximum occurring character in Java ..ftc

Write a Java program for, Given a string of even length, return the first half. INPUT_1:Enter any String: Deadpool OUTPUT:Dead INPUT_2:Enter any String: fcukthecode.co OUTPUT:fcukthe…Read More »First half of the string – Java program …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…Read More »Java program to create a Triangle …ftc

This problem practices the addition of 2-digit numbers. Encourage the students to share the methods that they use to solve the problem. For example some…Read More »Magician’s Numbers in Java …fcukthecod

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…Read More »Harmonic Number 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…Read More »Number Pattern 111111 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…Read More »Conversion from binary to decimal in Java …ftc

Swapping two numbers by multiplication and division Java Program to Swap two numbers by using division and multiplication. INPUT_1:Enter any two numbers: 3 2 OUTPUT:Swapped…Read More »Swap numbers by multiplication and division in Java …ftc

Java Program to convert from octal to hexadecimal number. INPUT_1:Enter Octal number: 10453 OUTPUT:Hexadecimal number is: 112B INPUT_2:Enter Octal number: 10452 OUTPUT:Hexadecimal number is: 112A…Read More »Conversion from Octal to hexadecimal in Java …ftc

Many people think about their height in feet and inches, even in some countries that primarily use the metric system. Write a program that reads…Read More »Many people think about their height in feet and inches [Java]…FTC

Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of…Read More »Area of pentagon in Java …ftc

Write a program that calculates the energy needed to heat water from an initial temperature to a final temperature. Your program should prompt the user…Read More »Calculate energy to heat water in Java …ftc

Create a program that reads a duration from the user as a number of days, hours, minutes, and seconds. Compute and display the total number…Read More »Units of Time days,hours,min to seconds in Java …ftc

Write a program to Convert the temperature from Celsius to Fahrenheit. INPUT_1:Celsius: 0 OUTPUT:Celsius to Fahrenheit: 32.0 F INPUT_2:Celsius: 30 OUTPUT:Celsius to Fahrenheit: 86.0 F…Read More »Celsius to Fahrenheit [Python] …ftc

In many jurisdictions a small deposit is added to drink containers to encourage people to recycle them. In one particular jurisdiction, drink containers holding one…Read More »Get deposit to recycle bottle in Java …ftc

Write a program that computes the body mass index (BMI) of an individual. Your program should begin by reading a height and weight from the…Read More »BMI (Body Mass Index) in Java …ftc