Difference Between HashMap and TreeMap in Java

Pradeep Kumar
Updated on 29-Jul-2022 11:42:50

3K+ Views

Both HashMap and TreeMap are considered to be Map classes because they both carry out the responsibilities of the Map interface. A Map is an object that stores key-value pairs, in which there is only one instance of each key but there may be multiple instances of the value. The hash table is a type of data structure that is utilised by the HashMap class. As a form of data storage, the red-black tree is utilised by the TreeMap.What is a HashMap?A HashMap uses a data structure known as the hash table in order to store the map's key-value pair. ... Read More

Convert 3-Digit Color Code to 6-Digit Color Code Using JavaScript

Kalyan Mishra
Updated on 29-Jul-2022 10:38:47

1K+ Views

In this tutorial, we will see how to convert 3-digit color code to 6-digit color code in JavaScript.So, basically three-digit color code represents the three-digit value of the colour of the form in #RGB format. To convert 3-digit color hex color to 6-digit we just have to do is convert every element of the three digit and make it duplicate.If we say in easy manner, then duplicating the three-digit color will give the hexadecimal whose value is same as three-digit color value.3-digit value: #RGB will be written as #RRGGBB in 6-digit color code.For example, 3-digit value: #08c 6-digit color Code: ... Read More

Swap Two Numbers in Swift Program

Ankita Saini
Updated on 29-Jul-2022 10:28:13

3K+ Views

This tutorial will discuss how to write a swift program to swap two numbers. Swapping of two variables means mutually exchanging the values of two variables.Swapping using temporary variableGiven two variables Number1 and Number2 now we swap their values with each other using a temporary variable Numtemp. It is the most easiest way to swap two numbers.AlgorithmThe algorithm is explained below −Step 1 − Declare three integer variables: Number1, Number2 and Numtemp(temporary variable.)Step 2 − Assign values to Number1 and Number2Step 3 − Assign Number1 to NumbertempStep 4 − Assign Number2 to Number1Step 5 − Assign Numbertemp to Number2Step 6 ... Read More

Find the Area of a Circle in Swift

Ankita Saini
Updated on 29-Jul-2022 10:10:06

1K+ Views

This tutorial will discuss how to write a swift program to find the area of a Circle.In a circle, an area is known as the space that is enclosed inside the boundaries of the circle in the two-dimensional plane. Suppose we have a round tea table now the area of the circle helps us to find how much cloth we required to cover the top of the table. We can calculate the area of the circle with the help of the radius or diameter, here, We are going to use the formula of area of the circle −Area of the ... Read More

Swap Numbers Without Using Temporary Variable in Swift

Ankita Saini
Updated on 29-Jul-2022 10:07:16

14K+ Views

This tutorial will discuss how to write a swift program to swap two numbers without using temporary variable. Swapping of two variables means mutually exchanging the values of two variables.Swapping two numbers without using temporary variablesGiven two variables Number1 and Number2 now we swap their values without using any temporary variable. Here we use tuple to preform the swapping operation.AlgorithmThe algorithm is explained below −Step 1 − Declare two integer variables − Number1, and Number2Step 2 − Assign values to Number1 and Number2Step 3 − Use tuple syntax to swap −(Number1, Number2) = (Number2, Number1)Step 4 − Display the value ... Read More

Add Two Numbers in Swift Program

Ankita Saini
Updated on 29-Jul-2022 09:53:04

4K+ Views

This tutorial will discuss how to write a swift program to add two numbers.Adding two numbers in Swift language is simple and can be performed with the help of the addition arithmetic operator(+). The arithmetic addition operator (+) uses two numbers as operands and returns their sum as output.In this operator, both the operands should be of the same data types, For example swift allows adding a float into float without an issue but if we will try to add different types of data types using (+) operator then the compiler will raise an error, For example adding an Int ... Read More

Print a String in Swift Program

Ankita Saini
Updated on 29-Jul-2022 09:50:50

955 Views

This tutorial will discuss how to write a swift program toprint a string. A string is a collection of characters such as “TutorialsPoint”, “Hello Purnima! How are you?”, etc. Strings can also be represented by Unicode. We can easily create and modifies a strings because they are lightweight and readable, also we can do string interpolation. Strings can be used to insert variable, constants expressions, etc.SyntaxFollowing is the syntax for creating string type variableVar a : StringAlgorithm to print two stringsStep 1 − Define 2 VariablesStep 2 − Enter string into that variableStep 3 − Perform operations with that stringStep ... Read More

Difference Between XHTML and HTML5

Pradeep Kumar
Updated on 29-Jul-2022 09:26:21

1K+ Views

People who are just starting out on the web often say that they have trouble identifying the difference between HTML 5 and XHTML. There is sometimes a lack of clarity on which of these languages is best for a beginner. It is not surprising that such misunderstanding continues to exist, given that both XHTML and HTML 5 serve, more or less, the same purpose.Go through this article to get an overview of XHTML and HTML 5 and learn how these two markup languages differ from each other.What is XHTML?XHTML stands for EXtensible HyperText Markup Language. The Internet has advanced to ... Read More

Difference Between WiFi and Hotspot

Pradeep Kumar
Updated on 29-Jul-2022 09:08:33

7K+ Views

Today, gaining access to the Internet does not need signing up for the data subscription plan offered by the Internet Service Provider (ISP). There are other available choices. The Internet can be accessed and shared in a variety of other ways, thanks to our smartphones.WiFi and hotspot are two terms that are sometimes used interchangeably to refer to connection to the Internet; however, there is a significant difference between the two. Hotspots are physical locations that are typically public places that are served by an access point that is used to connect devices to one another using WiFi. WiFi is ... Read More

Difference Between Von Neumann and Harvard Architecture

Pradeep Kumar
Updated on 29-Jul-2022 09:05:50

17K+ Views

There are two distinct varieties of digital computer architectures, each of which provides a description of the functioning and execution of computer systemsThe first is known as the Von Neumann Architecture, which was designed by the well-known physicist and mathematician John Von Neumann in the late 1940s.The second is known as the Harvard Architecture, which was based on the original Harvard Mark relay-based computer and used separate memory systems to store data and instructions. Both of these computer architectures were developed in the 1950s.In the original Harvard architecture, data and instructions were both stored in electro-mechanical counters, while the instructions ... Read More

Advertisements