- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
In this problem, we are given a value n, and we want to make change of n rupees, and we have n number of coins each of value ranging from 1 to m. And we have to return the total number of ways in which make the sum.ExampleInput : N = 6 ; coins = {1, 2, 4}. Output : 6 Explanation : The total combination that make the sum of 6 is : {1, 1, 1, 1, 1, 1} ; {1, 1, 1, 1, 2}; {1, 1, 2, 2}; {1, 1, 4}; {2, 2, 2} ; {2, 4}.Example#include ... Read More
Binomial coefficient denoted as c(n, k) or ncr is defined as coefficient of xk in the binomial expansion of (1+X)n.The Binomial coefficient also gives the value of the number of ways in which k items are chosen from among n objects i.e. k-combinations of n-element set. The order of selection of items not considered.Here, we are given two parameters n and k and we have to return the value of binomial coefficient nck .ExampleInput : n = 8 and k = 3 Output : 56There can be multiple solutions to this problem, General SolutionThere is a method to calculate the value ... Read More
In this problem, we are given a sorted array of rational numbers. and we have to search the given element using binary search algorithm for this rational number array without using floating point arithmetic.A Rational number is number represented in the form p/q where both p and q are integers. For example, ⅔, ⅕.Binary search is searching technique that works by finding the middle of the array for finding the element.for finding the element using binary search from a sorted array of rational numbers, where floating point arithmetic are not allowed. We will compare the numerators and denominators to find ... Read More
This example demonstrates how to do I pass an image from one Activity in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void SendImage(View view) { ... Read More
This example demonstrates how to do I disable ScrollView programmatically in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. ... Read More
This example demonstrates how to do I check the system version in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Build; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = findViewById(R.id.textView); double ... Read More
This example demonstrates how to do I in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import java.util.Timer; import java.util.TimerTask; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); ... Read More
This example demonstrates how to do I in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { EditText etName, etEmail; SharedPreferences sharedPreferences; public static final String myPreference = "myPref"; public static final ... Read More
This example demonstrates how do I get the distance between two geographic locations in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.location.Location; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = findViewById(R.id.textView); ... Read More
This example demonstrates how do I delete SharedPreferences data for my android app.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. Step 3 − Add the following code to res/strings.xml Sample player_name country_name Step 4 − Add the following code to src/MainActivity.javaimport androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView textView, tvAfterDelete; ... Read More