Category "data-structures"

create string r using string p and q, C++, Data Structures, Strings [closed]

In this question we have given 3 strings and we nee dto count possible number of ways to create string r using string p and q

Which is the best way to represent my data

I have a following data structure: Page0 Key0 Text Color Name Key1 Text Color Name Page1 Key0

looping through an array of objects that contains three key, value pairs

I have these objects, which could be in an array, like in the example or a database: [ { "payer": "DANNON", "points": 1000, "timestamp": "2020-11-02T14:00:0

Data structure for iterating between players

I am new to programming, so I started working on a small guessing game for n players In theory they are supposed to take turns trying to guess some String, I've

Efficiently and constantly reorganize searchable data based on access frequency

I want to be able to organize data for efficiency and constantly update the order of that data based on frequency of access, relevancy, and accuracy. For exampl

Practicality of the position attribute of a Positional List Implementation in Python?

I am reading Chapter 7 of Data Structures and Algorithms in Python and I am finding the Positional List ADT quite hard to understand, the implementation given b

How to struct an object to represent a list of topics?

I'm coding at C# and I'm trying to make an OOP representation of a list of topics. I tried countless approaches but I still not being able to reach the desired

What is big O of this pseudocode?

For this pseudocode, what would be big O of this: BinarySum(A, i, n) { if n=1 then return A[i] // base case return BinarySum(A, i, n/2) + Binar

Reduce time in searching a list of strings with Regex

I have 130,000 records of strings. I want to find the number of occurance of each string element in those 130,000 records by doing the regex search for each rec

longest subsequence: missing last element

Hi guys I'm working on the longest subsequence algorithm, the idea is to find the subsequence of numbers from an array. I'm using Ruby, so far I'm missing the l

Are there any Datastructure and Database feature that could handle tag of tags?

I want to categorize data to search for content that can be tagged. However I want a tag to have relationship with other tag too and so it could be searched for

Compare HashMap Values structured as List [closed]

I have a HashMap structured like {a=[test], b=[test, test2]} I want to compare entry values (test, test2) with each other and if any entry ha

What is wrong with Insertion Sort on Doubly Linked list?

I am getting some random result. I have gone through the flow and did dry run several time but can't figure out exactly what's wrong with the code. flow of prog

How to validate request which built from other classes?

There is a class UserRequest class UserRequest { private Name name; private Address address; private Date dob; //getters and setters } This class is bu

Printing all the paths in a tree from root to each leaf

I am trying to print all the paths from root to leaf in a tree, but having some issues collecting the path items. Consider the following graph: In my case thou

How __iter__ works for printing linked list

I'm trying to learn linked lists and I'm stuck at the point where the instructor wrote down the __iter__ method. Although I particularly don't understand the pa

Questions regarding Red-Black Tree Deletion (z has 2 children) (pre-fixDelete)

Code Source - https://github.com/Bibeknam/algorithmtutorprograms/blob/master/data-structures/red-black-trees/RedBlackTree.cpp y = z; int y_original_col

Find the nth character of an increasing sequence

Recently i saw a competitive coding question, the bruteforce approach doesn't meet the time complexity, Is there any other solution for this, Question: An expan

K-connectivity reflective, symmetric, transitive

I have to prove the following: In a directed graph if there are k distinct paths (which don't use the same edges) from vector x to y and also there are k distin

minimum number of jumps dynamic programming

I wrote this code to solve a problem called minimum number of jumps which basically asks what are the minimum number of jumps it takes to get from the beginning