Questions tagged [data-structures]

A data structure is a way of organizing data in a fashion that allows particular properties of that data to be queried and/or updated efficiently.

31,787 questions
0votes
0answers
8views

Python -The iterable variable does not update after being updated inside the for inside

The problem was from Educative website Detecting String Pattern In this coding exercise, you are asked to write the body of a function called detect pattern that returns true or false depending upon ...
0votes
0answers
7views

while i insert a node into a binary tree. It is Showing Node' object has no attribute 'insert error

enter image description here This is my code.
-1votes
0answers
20views

Split 1 row into multiple fractional rows

I'm working on a restaurant POS system and I'm trying to devise a splitting system in order to split items into fractional quantities over multiple orders. Here is simple summary of what I have so far:...
-2votes
1answer
34views

Why do I have to make a 2d array for this

I was solving a question online on strings where we had to perform run-length encoding on a given string, I wrote this function to achieve the answer using namespace std; string runLengthEncoding(...
0votes
0answers
10views

Which case am i not considering in implementing Predecessor and Succesor function for Binary Search Trees?

This is my code.actually the difference with standard implementations is they use a temp pointer when searching for predecessor and succesor. void findPreSuc(Node* root, Node*& pre, Node*& suc,...
0votes
0answers
35views

Toggling properties using recursion | Checkbox tree

I am trying to implement a checkbox tree in react that can toggle checked property nodes according to the following rules If a parent is checked/unchecked, all the children and grandchildren will be ...
0votes
0answers
32views

Can anyone explain a bit about what's happening in the C code? [closed]

int comp(const void*a,const void*b)//Function used for comparison. { return *(int*)a-*(int*)b; } bool containsDuplicate(int* nums, int numsSize) { if(numsSize <= 1) return false; qsort(...
-5votes
0answers
35views

Java Recursion with map values as key [closed]

public class Test { private void findTermMatches(StringBuffer sb, List<String> termMatches, Map<String, List<String>> resultMap, List<String> searchedList) { ...
0votes
4answers
50views

javascript Object.assign() without overriding fields

Is there any way to merge two objects, like Object.assign(a, b), but I want the same field in a keeps its origin value (without overriding from b). a = {x: 1, y: 2} b = {y: 3, z: 4} Object.assign(a, ...
1vote
2answers
70views

Toggling checkboxes using recursion | Recursion problem

I am trying to implement a checkbox tree that has the following data structure for items const checkboxes = [{ field: 'ARTICLE', id: 41, name: 'Article', parentId: null, checked: ...
-2votes
0answers
17views

I am making a web application and I want to write an algorithm. I am using MERN as technology stack [closed]

which framework should I write this algorithm on ? or do I separately need to write the algorithm on any other framework/language than current MERN stack? if yes, which would be that language.
-1votes
1answer
80views

Construct a binary tree and traverse it in pre-order [closed]

Let's say i need to build this tree from the digits 61207895 and then perform a pre-order traversal of the tree. 6 / \ / \ / \ 1 7 / \ / \ 0 ...
0votes
1answer
17views

From local Excel sheets into dashboard online

I have around 30000 sheets of excel with standardized report. The goal is to provide online dashboard to view the data. My first thought as programmer is to create a database and find a way to import ...
0votes
0answers
28views

AVLTree compare two trees (operator== implementation)

Im overriding the operator== to compare two trees. The problem I have is I need them to be equal if they have the same elements inside and not if the elements are placed in identical places. If in ...
0votes
0answers
15views

Find the maximum value of the cargo

A cargo load to be prepared from the types of articles. The weight wi, volume vi and monetary value ci of different articles are given below: | Article Type | wi | vi | ci | | ------------ | -- | -- | ...

153050per page