Detect Loop in a Linked List using Python

Kavya Elemati
Updated on 24-Apr-2023 17:37:46

981 Views

A linked list is said to have a loop when any node in the linked list is not pointing to NULL. The last node will be pointing to one of the previous nodes in the linked list, thus creating a loop. There will not be an end in a linked list that has a loop. In the below example, the last node (node 5) is not pointing to NULL. Instead, it is pointing to the node 3 and a loop is established. Hence, there is no end to the above linked list. Algorithm Take two pointers fast and slow ... Read More

Outline Effect on Text

Shubham Vora
Updated on 24-Apr-2023 17:30:02

390 Views

Sometimes, we require to show only the text's outline and remove the text's fill. We can also say it is the outline effect. We can use various CSS properties to generate an outline effect for the text. For example, we can add a border to the text and remove the fill colour of the text to add an outline effect to the text. Here, we have three different approaches to showing text with outline effects using HTML and CSS. Using the Various CSS Properties In this approach, we will use the three CSS properties to add an outline effect to ... Read More

Get Middle Element of a Linked List in Python

Kavya Elemati
Updated on 24-Apr-2023 17:24:17

1K+ Views

Linked list is used for storing the data in non-contiguous memory locations. The nodes containing the data items are linked using pointers. Each node consists of two fields. The first field is used for storing the data and the second field contains the link to the next node. Brute Force Technique To find the middle element of a linked list, the brute force technique is to find out the length of the linked list by iterating the entire linked list till NULL is encountered and then the length is divided by 2 to get the index of the middle element. ... Read More

Difference Between Position Sticky and Position Fixed in CSS

Shubham Vora
Updated on 24-Apr-2023 17:22:58

13K+ Views

In CSS, the ‘position’ property is used to set the position in the viewport for the HTML element. It can have values such as ‘fixed’, ‘sticky’, ‘static’, ‘absolute’, ‘relative’, etc. In this tutorial, we will learn the difference between the ‘position: fixed’ and ‘position: sticky’. What is Position: Fixed in CSS? The ‘fixed’ value for the position property is used to set any element at the fixed position in the HTML viewport. Whenever we set the fixed position for any HTML element, it comes out from the document flow. It sets the position based on the viewport, even if we ... Read More

Styling Text Input Caret

Shubham Vora
Updated on 24-Apr-2023 17:11:57

591 Views

In the text input of the HTML, you can observe the marker showing at the editing position in the text, called the text input caret. Also, it is known as a text input cursor. In this tutorial, we will learn to style the text input caret. However, we can only change the color of the text input caret as changing shape is not supported by modern browsers. Syntax Users can follow the syntax below to use the ‘caret-color’ CSS property to change the color of the text input caret. caret-color: color; In the above input, ‘color’ can be the ... Read More

Wave Inside Text Using Pure CSS

Shubham Vora
Updated on 24-Apr-2023 17:10:37

1K+ Views

Developers can use CSS to add animation to the HTML element. Here, we will use CSS to add a wavy effect inside the text. It will look like a real wave in text Here, we have three approaches to add a wavy effect to the text. We will take a look at all approaches one by one. Syntax Users can follow the syntax below to add a wavy effect to the text. @keyframes wavey { 0%, 100% { /* add initial clip-path */ } ... Read More

What is Tree Shaking in JavaScript

Shubham Vora
Updated on 24-Apr-2023 17:07:18

316 Views

What is Tree Shaking? If you are an experienced JavaScript developer, you may hear about tree shaking. It is a common technique to remove unused codes from the application and also, and it removes unused imports from the application. Here, the ‘Tree shaking’ term is introduced by shaking a tree, removing unnecessary branches of the code, and keeping the required code in the final bundle. Basically, tree shaking is used to eliminate the dead or unused code. Why do we Require Tree Shaking? As we have seen in the above part of the tutorial, tree shaking is used to remove ... Read More

What is Server-Sent Events in JavaScript

Shubham Vora
Updated on 24-Apr-2023 17:06:31

1K+ Views

What is Server-sent Events in JavaScript? In JavaScript, server-sent events (SSE) enable the server to send data to the client. The client require to establish a connection with the server to get data from the server. The server-sent events are similar to the WebSocket as it also establishes a connection between the client and server, and it is useful to send data on both sides. But server-sent events allow unidirectional communication, which means the server can send data to the client, but the client can’t send data to the server. Let’s build a real-time React and Node application to use ... Read More

Events Available for Server-Sent Events in JavaScript

Shubham Vora
Updated on 24-Apr-2023 17:05:06

401 Views

The server-sent events allow developers to open a connection between the server and the client and send data from the server to the client. Basically, it is a one-way communication, which means we can send data from the server to the client but not from the client to the server. Here, we will discuss all events available for the server-sent events in JavaScript. Events Available for Server-sent Events in JavaScript There is a total of 4 different events available for server-sent events in JavaScript. ‘onopen’ − The ‘open’ event fires when the connection between the client and server is ... Read More

Text to Voice Conversion Using Web Speech API of Google Chrome

Shubham Vora
Updated on 24-Apr-2023 17:03:52

1K+ Views

Nowadays, the audiobook is more preferred by readers to reading books as they can grab knowledge while doing any work by listening to it. Also, some website adds the audio of the article in every article, so if users don’t want to read the article, they can listne to it. To convert normal text to voice, we require to use the web speech api of Google Chrome. In this tutorial, we will learn to use the web speech API of Google Chrome to convert text to voice. Syntax Users can follow the syntax below to use the web speech API ... Read More

Advertisements