An identity matrix is a square matrix of dimension n which contains ones along the principal diagonal and zeros in rest of the other positions. A 2×2 matrix is as follows: 1 0 0 1 For example, 4×4 matrix is shown below. Java Program Please note that Java does not have true multi dimensional […]
ArrayList is a resizable array in Java. It is implementation of the List interface. Array is fixed in size, whereas ArrayList can grow or shrink dynamically as needed to accommodate adding and removing elements. ArrayList is random access list. It supports fast and generally constant access time for the elements. You can add duplicate elements […]
String Literals vs String Objects String is associated with string literal in the form of double-quoted text. You can assign a string literal directly into a String variable. String objects are created by new operator and String constructor. However, this is not recommended in Java. Strings are immutable String is an immutable sequence of Unicode […]
Problem Statement: Implement Two Stacks in an array. Implementation details are same like normal stack operations. # You can push items to one of the chosen stack say stack1 or stack2.
Prove that : for n ≥ 1 and n ∈N Hints for solving the problem : Use Mathematical Induction P(1) = Holds true. Assume that for k ( a positive integer ) P(k) holds true. i.e Now prove that P(k+1) is true.
Two-factor authentication(2FA) adds an extra layer of security to your GitHub account. In addition to your username and password, you’ll need to enter a code that GitHub sends to you via text or an app on your phone or tablet.
JavaFX API JavaFX API is used for creating GUI rich desktop applications also called as Rich internet applications (RIAs). It is a set of Java libraries designed to enable you to create and deploy rich client applications that have rich UI controls. It can be used to create graphical user interfaces for many platforms. I […]
GitHub Desktop is a desktop application for Windows and Mac OS platforms. It allows you to work with projects on GitHub and GitHub Enterprise. You can add projects to, create, develop, and track the project in a helpful graphical interface(GUI).
Problem Statement: A person with a goat,wolf, and cabbage is on one bank of the river. Given a boat as shown in the diagram. The boat is capable to carry the person and only one of the three (viz goat ,cabbage and wolf). Conditions: The person cannot leave the wolf and goat unattended on either […]