Data Structure Articles

Page 78 of 164

Linked List Allocation

Diksha Patro
Diksha Patro
Updated on 03-May-2023 10K+ Views

A dynamic memory allocation method used in computer programming is called linked list allocation. In this method, a linked list data structure is used to distribute memory. Memory is divided into a number of blocks of similar size when allocating a linked list. In the linked list, each block is symbolized by a node. A pointer to the following piece of memory is present at each node in the linked list. The final node in the linked list has a null pointer that serves as a marker for the list's conclusion. Linked list data structure and its implementation in memory ...

Read More

Binary Space Partitioning

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 20-Apr-2023 6K+ Views

A binary space partition is a data structure used in computer graphics and algorithmic geometry to divide a space into smaller parts. BSP was developed in the environment of 3D computer graphics. BSP includes applications such as operation with geometrical shapes, geospatial, and ray tracing. It is a two-step procedure Step 1 − Creation of BSP tree. Step 2 − Display a tree. Creation of BSP tree Visual Representation of Binary Space Partitioning The binary Space Partitioning algorithm recursively divides the space into two half-spaces. So keep in account that there is a dividing region in every polygon figure. ...

Read More

Pythagorean Quadruple

Vanshika Sood
Vanshika Sood
Updated on 19-Apr-2023 880 Views

A group of four positive integers (a, b, c, and d) that satisfy the Pythagorean equation are called Pythagorean quadruples. The equation can be written as: a2 + b2 + c2 = d2 , with ‘d’ being the largest value out of the given numbers. In other words, the square of the fourth integer should be equal to the sum obtained by adding the squares of the previous three numbers. (1, 2, 2, 3) is a Pythagorean quadruplet as (12 + 22 + 22) = (1 + 4 + 4) = (9) = (32). Due to the requirement ...

Read More

Palindromic Selfie Numbers

Vanshika Sood
Vanshika Sood
Updated on 19-Apr-2023 398 Views

A number is considered to be a “Selfie Number” if it can be represented using only its own digits and certain mathematical operations. For example, 936 is a selfie number. $$\mathrm{936\:=\:(\sqrt{9})!^{3} \:+\:6!\:=\:216\:+\:720\:=\:936}$$ Here it can be observed that a series of operations are performed on the digits of the original number and the resultant is equal to the original number. Palindromic Selfie Numbers are a special kind of selfie number. They satisfy the selfie multiplicative rule. Consider a number x. Let the number formed by reversing the digits of x be $\mathrm{x^\prime}$. Let y be a ...

Read More

Closest Numbers from a List of Unsorted Integers

Vanshika Sood
Vanshika Sood
Updated on 19-Apr-2023 2K+ Views

In the following article, we discuss two approaches to find the closest numbers from a list of unsorted integers. Let us first understand what is meant by the term ‘closest numbers’. Closest numbers are the pair(s) of numbers which have the least difference between them. Problem Statement Given a list of distinct unsorted integers, we need to find the pair of elements that have the least difference between them. If there are multiple pairs, we need to find all of them. Furthermore, in the article wherever there is a mention of difference, it means absolute difference. Examples Input: [44, 42, ...

Read More

Delete a Linked List Using Recursion

Vanshika Sood
Vanshika Sood
Updated on 19-Apr-2023 1K+ Views

Linked List A linked list is a linear data structure in which the elements are stored at non-contiguous memory locations. Each element consists of a node. A node is composed of a data field, which holds the value of the element, and an address field, which points to the location of the next node in the series. The first node of the linked list is referred to as the ‘head’ of the list. The last element of the linked list can be defined as the element which points to NULL. A diagrammatic representation of a linked list is shown below. ...

Read More

To Check if a Number is a Munchhausen Number

Vanshika Sood
Vanshika Sood
Updated on 19-Apr-2023 928 Views

Munchhausen Numbers are peculiar numbers which possess a unique property. A number is considered to be munchhausen if the sum of the digits of the number, raised to their own power, is equal to the original number. These numbers are uncommon and not many of them are known. If the definition 00 = 0 is used, then 0 can also be considered a munchhausen number. The following article provides a method to determine whether a number is munchhausen or not while keeping in mind these characteristics of munchhausen numbers. Problem Statement The task at hand is to check whether a ...

Read More

Difference between Map and HashMap

Pradeep Kumar
Pradeep Kumar
Updated on 18-Apr-2023 12K+ Views

We can store and retrieve key-value pairs using two popular data structures in programming: maps and hash maps. They both serve to symbolize a group of components that may be accessed by means of a special key. A collection of key-value pairs is represented using a Java interface called a Map. It is an abstract data type that offers methods for accessing, adding, and removing elements as well as a way to map keys to values. On the other hand, a HashMap is a real-world application of the Map interface. What are Maps? In computer science, a map is a ...

Read More

Difference between ARP and RARP

Pranavnath
Pranavnath
Updated on 18-Apr-2023 9K+ Views

ARP and RARP are the LAN (Local Area Network) protocols. A LAN is a fast, fault-tolerant data network that only covers a limited area of land. There are three types of LAN data transmissions unicast, multicast, and broadcast. A single packet is transferred from the source to a destination on the network during a unicast transmission. A single data packet is copied and delivered to a certain group of network nodes as part of a multicast transmission. A single data packet is copied and delivered to every network node as part of a broadcast transmission. Both ARP and RARP use ...

Read More

Sort an array containing two types of elements

Vaishnavi Tripathi
Vaishnavi Tripathi
Updated on 11-Apr-2023 415 Views

There are different approaches to sort an array containing only two types of elements i.e., only 1’s and 0’s. We will discuss three different approaches to do so. First approach simply uses a predefined sort() function to sort the given array. Second approach is a count sort approach in which we will count the number of zeroes and ones and then update the array by first writing zero for the number of times 0 was counted and then writing 1’s for the number of times we counted one. In the last approach, we used the two pointer method. Problem statement ...

Read More
Showing 771–780 of 1,635 articles
« Prev 1 76 77 78 79 80 164 Next »
Advertisements