Questions tagged [data-structures]

A data organization method aims to efficiently query and/or update specific properties of the stored information through a structured arrangement.

What is the method for setting and comparing collectionsjs equality?

I'm interested in utilizing the data structure. Within the factory method, you have the opportunity to specify equals and compare parameters: SortedMap(entries, equals, compare). Can anyone provide insight into what the expected formats for these paramet ...

Exploration of an extensive dataset halted by reaching the maximum recursion limit

I am currently facing an issue while implementing DFS search in Python. To manage the nodes, I am utilizing the networkx library to represent them in a graph data structure. The dataset consists of 5 million nodes. Following the conversion of the stored da ...

Reverse changes made to a massive object and then redo them

My current project requires the implementation of undo-redo functionality for a product. At the moment, I am managing a substantial Object retrieved from a MongoDB collection The structure is as follows: { cart:{ products:[ { name: " ...

Data structure designed specifically for a drawing tool application

Currently, I am in the process of developing a unique sketching application using the HTML5 Canvas element. Despite my progress, there is one particular challenge that has stumped me. The main concept of the application involves allowing users to manipula ...

Organizing seating arrangements for a concert hall performance

My goal is to develop a custom concert seat booking system using HTML, CSS, and JavaScript. For example, if the concert venue has 10 rows with 20 seats in each row, I could organize them like this: const rows = [ { name: 'A', seats: [1, 2, 3, 4] }, { ...

Algorithm for identifying articulation points - detecting back edges

Currently, I am studying Tarjan's algorithm to identify articulation points in a graph through DFS. https://www.geeksforgeeks.org/articulation-points-or-cut-vertices-in-a-graph/ In this context, some important notations are: low[] : Array of N elem ...

A Fresh Approach to Altering Dictionary Organization

In Python, I am working with an object type that contains multiple entries in the data-object. An example entry is shown below: > G1 \ jobname x [3. ...

Breaking down a string into separate columns

Hey there! I'm new to python and currently tackling a csv file with a column that has a messy string object like this: I have a few questions: How can I neatly split the data into columns of my choosing? In relation to the image, how can I organize ...

Is there a way to display the button just once in a map function while still retaining access to the iteration value?

Utilizing formik within material-ui for a form has been quite productive. I've implemented a map function to print text fields and managed to display the Submit button only once by targeting the index. However, there's an issue when attempting to access ea ...

Utilizing Node.js with Redis for organizing data efficiently

Currently, I am in the process of configuring a Redis cache system for storing incoming JSON data in a specific format. My goal is to create an ordered list structure to accommodate the large volume of data that will be stored before eventual deletion. Th ...

What would be the best way to structure this workflow as a JavaScript data format?

I have a complex workflow that I need to represent as a JavaScript data structure. This workflow involves a series of questions and answers where the response to one question determines the next one asked. Here is a basic example of what this workflow migh ...

Changing the value of an object property (illustrated using a basic linked list)

I am working on a JavaScript Link List implementation as a beginner, and I have written the following code: var LinkList = function () { this.LinkedList = { "Head": {} }; }; LinkList.prototype = { insert: function (element) { var Node = this ...

In Python, update a dictionary only if the value is defined

Consider this code snippet: import json foo_data = [ { "name": "Bob", "occupation": "", "standing": "good", "locations": ["California"], "meta": { "last_updated": "2018-01-15" } }, { "name": "", ...

Arrange the values in a dictionary in ascending order while arranging the keys in descending order

I am attempting to organize a dictionary in a specific order. I would like the dictionary to be arranged first in ascending order based on values, and if there are two or more keys with equal values, then I want them to be sorted by the keys in descending ...

What advantages does a DoublyLinkedList offer when used in PHP?

Recently, I stumbled upon the PHP-SPL data structures and decided to explore the first one: the doubly linked list. While I have a basic understanding of a linked list, grasping the concept of a doubly linked list made me wonder: What practical application ...

Tips for changing binary heap sort into d-ary heap sort:

Hey there! I have an algorithm that utilizes a binary tree for heapifying and sorting a list. I am looking to modify this sorting algorithm to work with a d-heap, d-ary heap, or k-ary heap structure instead. Here is my code: def build_heap(lista, num): ...

The misleading A*(A-star) algorithm inaccurately produces faulty routes and ultimately collapses

I am currently working on implementing the A*(A-star) algorithm in react.js, but I am facing a problem. Whenever the startNode (green) or destinationNode (blue) have more than one neighbour or if there is a cycle in the graph, my program crashes. There see ...

"Challenges encountered while using the sort function in Merge Sort implementation with Python

I've been facing some challenges with my attempt to make the merge sort algorithm function properly. Despite a seemingly successful merge function, the sorting part just doesn't seem to be working as expected. I've tried researching online for solutions ...

Arrange a collection of objects based on various nested properties

I am faced with the challenge of managing an array of objects representing different tasks, each categorized by primary and secondary categories. let tasks = [ { id: 1, name: 'Cleanup desk', primary_category: { id: 1, name: 'Indoo ...

Tips for fixing the Python error message "can only concatenate str (not "float") to str" when trying to return a string

I have been working on a project to determine the percentage of landmass that a country occupies compared to the total landmass of the world. My function takes in two arguments, one as a string and the other as a float, and returns a string with the calcul ...

Discover the Practical Utility of Maps beyond Hash Tables in Everyday Life

I am currently attempting to explain the concept of Maps (also known as hash tables or dictionaries) to someone who is a beginner in programming. While most people are familiar with the concepts of Arrays (a list of things) and Sets (a bag of things), I ...

What is the most effective way to organize dictionary-like observations based on time in Pandas?

Looking to analyze a large dataset of observations tied to specific datetimes that can be represented either as dictionary objects or custom objects. Here's an example: Datetime | Data -------------------------------------------------------- 2018- ...

Tips for organizing a search using two keys in Javascript

I am dealing with a large dataset containing over ten thousand objects that hold information about two different ids as shown below: dataSet = [ { ids: ["123", "234"], information: 1 }, { ids: ["123", "345"], in ...

Can I consolidate identical terms into a single column in a pandas dataframe?

Within this extensive pandas dataframe, there are several terms: type name exp ------------------- feline tiger True feline cat False rodent rabbit True canine dog False feline puma True feline bobcat False Are there ways to consolid ...