
the add method() only prints just two value, I want to print all the number what I added. size does work well but I do not know why value does not work when i want to print all the value
enter ...

I am currently doing some graph data structures problem and i did encounter with adjacency matrix and list to represent a graph in computers memory, but this thing clicked on my mind if we can use BST ...

I’m creating Food Directory services chatbot. I want to store data as keywords which is supported muliti languages , similar word searching, cache for frequently word search and analysis keyword ...

For the below problem implemented in GoLang:
package recursion
import (
"fmt"
"strconv"
)
// m is the number, n is uptolength of subsequences
// m = 20125, n =3 should print 201, 202, 205,...

I am trying to print my values from queue without modifying the queue basically ı want my queue to be same before and after the print. I thought to copy the elements to a temporary queue and print the ...

I have a problem where I have a road that has multiple entry points and exits. I am trying to model it so that traffic can flow into an entry and go out the exit. The entry points also act as exits. ...

Is it possible to store a whole array as a node in a linked list. I am using the Linked List collection java provides and I keep getting an error for the following code.
List<Object[]> params =...

The documentation simply states that there are fewer functions allowed with SimpleQueue. I need very basic queue functionality for a multithreading application, would it help in any way to use ...

I was solving a problem on Hackerrank where I got error maximum recursion depth exceeded. Is it okay to increase the recursion limit or that should be avoided?
Also what adverse effect does it bring ...

I am doing JS Algorithms and Data structures projects in freecodecamp and I am stuck at the last problem "Cash register". I already did some of the coding and my code doesn't pass all the tests.
The ...

The problem:
Given a sorted array in nondecreasing order, return an array of squares of each number, also in nondecreasing order. For example:
[4,2,1,0,3,5] > [0,1,4,9,16,25]
I'm trying two...

I want to understand this intuitionally, not mathematically.
Facts I know :
This is for strictly binary tree(0 or 2 child).
The Number of Leaf Nodes is either half of total nodes or 1 more
(Means it ...

Algorithms & Data Structures. This venture covers an assortment of
subjects identified with the information structures. I have composed a
perfect and productive answer in Python, just as a ...

Suppose I have a vector of ranges and I want to partition them into multiple partitions. Note that this is not the same as what std::partition does, which is to find a single partition point. I'm ...

I have a question understanding subproblem in dynamic programming. For example:
Problem statement is as follows
You are a professional robber planning to rob houses along a street. Each house has a ...

Consider a warehouse of nonintersecting axisaligned boxes. With which data structure I can find a spot for a box, get all free volume as a set of AABBs, or get a list of intersected boxes in the ...

I'm working on a android application using Firebase Firestore and i am still not content with my datastructure.
In my application there are users who can create and join different groups.
What i ...

You all must have seen a seven segment display.If not here it is shown in the picture below.
Alice got a number written in seven segment format where each segment was created using a matchstick.
...

no output printed can you please spot errors in these code??I tried to create linked list and insert and print the data but its not showing me in the output
class node:
def __init__(self,data):
...

given the task of finding words which share a common prefix with a given word, which data structure would have the optimal expected asymptotic performance?
Multiple choice:
a) binary tree
b) hash set
...

Here is the question:
There are n switches in the campus. You are required to create a mesh topology for the switches. Write a recursive method to returns the total number of connections required for ...

For function f(n) and time t in the
following table, determine the largest size n of O(log(n)^2) that can be solved in time t, assuming that the algorithm to solve the problem takes f(n) microseconds]
...

a data provider and data processing unit that is alive throughout the app life cycle and is available to all activities inapp
Blockquote
what should I use in this case?

So I'm trying to make a working calculator using RPN (reverse polish notation), however, it works perfectly fine using positive numbers and doing a simple substract like (3*42+5)/3*2 which postfix ...

I know that a std::vector supplies an O(1) random access function but only has an O(N) insertion/removal function due to having to shift elements to make new space or fill up old space.
On the other ...

I was attempting a question on leetcode and not sure about this anomalous behaviour. I am providing the logic part of the question. Please let me know if any discrepancy is found.
Question: Design ...

So, I am working on a program where you have to generate the YAML file which represents the directory tree from a given directory location(path). For example..
sc
├── file.go
├── file_test.go
└── src
...

I'm translating some code from C++ to C#. The code is simple enough and most of the syntax involved is almost the same, however the C++ version uses a vector<vector<int>> structure that ...

Here is my problem:
Given a set of arrays of size N and an integer K, you have to find the maximum integer for each and every contiguous subarray of size K for each of the given arrays.
example:
...

I tried and saw multiple solutions for the above question but could not find a solution that suits my case.
I have following list of dictionaries.
input_list = [
{'k0':'v0','level':0,'...

I have a trie that contains base 62 alphanumeric keys, of 100B in length. I have 5 x 10 ^ 11 keys. How can I estimate how much RAM / disk space would be required to store this trie?

Maps give O(1) lookup. Can't we go through the array once and build a map corresponding to its index (the opposite of array) and when we want to search something we can call map[VALUE] and it will ...

Hello i have a problem with my code, actually it works from c but not for c++, its got error message.
i tried searching google and these threads but i didn't find anything. if you guys find a link or ...

I've been given a very unusual assignment and been trying to solve it for a couple of days now:
The average depth of a node in some tree T, which has n nodes, is (1/n)∙Σ𝑥∈𝑉(𝑑𝑒𝑝𝑡ℎ(𝑥)) (where V ...

Can I get the clarification for the below question?
Given that 2 nodes one is R/W and another was a backup node, the backup node can have out of sync data, I have give few APIs like load, extract ...

I was solving some linked list question and came across an error "System cannot find the file specified". Let me brief the problem. For inserting element in single linked list I used following ...

I am trying to make a circular doubly linked list using a binary tree using following function, But its throw Compilation error, given below the code.
/*Node is as follows:
struct Node
{
int data;...

This is from codewars. Problem statement is as follows :
We want to generate all the numbers of given number of digits 'digs' where:
1. the sum of their digits is equal to given int 'sum_digs'.
2. ...

I was asked to implement a data structure. After a few attempts I got in trouble, I would like to get ideas on how to implement the following methods using AVL and Hash table:
Suggest an ADT that ...

What is the different ways to implement Priority queue?
I read that :
Priority Queue can be viewed as:
View 1: Priority queue as an ordered list.
View 2: Priority queue as a set.
what is the ...

For some reason, the manipulated doubleArray below is not shown in the console. Any variables that I declare after the for loop won't show to the console on both cases. Consider that in the first ...

Use the lexicon file content and build a Trie tree for it in python.Call this routine create_trie. It should return the top node of the trie tree.
Create a routine called tokenize that takes as input ...

Is there an Entry mechanism for BTreeMap that allows returning an immutable reference?
Take the following code, which implements a kind of sparse vector. Essentially, it's a vector that assumes the ...

I try to find implementations of a double linked list with the search method or get method. I try to find implementation will be less than O(n). Maybe it will be mixed structures: double linked with ...

Using find_partial and split_node methods, create a new method add_word.
It should work as follows:
For a new word,make_word like ‘careless’, where it does not need to split a node, and a word like ‘...

I want to write code in
java
for creating an array for a given range in BST.
I found only code for Count BST nodes that lie in a given range
I thought maybe to find first the length of the ...

How to sort a list of strings based on order mentioned in static map having item of list as key.
List={"AU","I","U", "O", "A1"}
Need to sort the above list of string using the below map which has ...

I'm a newbie software student and this is my first time around here so sorry if I'm posting on the wrong place. I have an assignment that consists in reading a text file with A LOT of lines (40 of ...

I am new in JavaScript data structure. I am working on linked list in JavaScript. I want to create a function which can find the distance between nodes. I have created a function which work perfectly ...

First of All, Sorry for my Bad English... I am Student of Bs Software Engineering 3rd Semester.I want to land a job in big companies like Google,Microsoft,Amazon etc.And currently I am working on ...