Category "data-structures"

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

Getting Segmentation Fault in the problem "Maximum Rectangular Area in a Histogram" on GFG

Problem: Maximum Rectangular Area in a Histogram link: https://practice.geeksforgeeks.org/problems/maximum-rectangular-area-in-a-histogram-1587115620/1 Website:

6- Write this client method using only the push(), top(), pop(), and isEmpty()

6- Write this client method using only the push(), top(), pop(), and isEmpty() methods: public static void reverse(ArrayStack stack) // reverses the contents

What is the difference between these two codes? (Python: circular singly linked list)

These are the codes for __iter__ method of a circular singly linked list. But I don't understand the difference between the two. def __iter__(self): node =

What is the difference between these two codes? (Python: circular singly linked list)

These are the codes for __iter__ method of a circular singly linked list. But I don't understand the difference between the two. def __iter__(self): node =

Does the code load the data on the linked list?

Does the code load the data on the linked list? and the printing method to verify that the data is present in the linkedlist, is it correct? This is the data fo

How to create a nested data structure from 2 arrays?

Hi guys I get confused trying to qcheave this, so any help would be great! I have two arrays from which I need a specific object. Source arrays: 1-Types (1D):

BubbleDown function(min heap) not working

I have generated a minheap to this file but I think something I have missed but I can't identify what are the things I have missed. I have missed something on

How to get list of palindrome in text? [closed]

I have the following interview question that may require traversing through the entire string. Problem I searched about find Problem and most