Skip to main content
0 votes
0 answers
111 views

I am implementing Red-Black Tree deletion (CLRS-style). I understand the general delete logic, but I am confused about this specific line: if (y->parent == z) { if (x) x->parent = y; } ...
Engineering Team's user avatar
1 vote
1 answer
85 views

I am working on a real-world navigation problem where a city road network is represented as a weighted graph (distances in kilometers). The goal is to compute the shortest path from North Nazimabad to ...
rani's user avatar
  • 11
-4 votes
1 answer
94 views

I am working on a real-world navigation problem where a city road network is represented as a weighted graph (distances in kilometers). The task is to compute the shortest path from North Nazimabad (...
user30659876's user avatar
-2 votes
0 answers
124 views

Code 1 In code one we are using the binary exponentiation. public class Solution { public int pow(int A, int B, int C) { if (C == 1) return 0; long base = (A % C + C) % C; ...
Prashant Vats's user avatar
3 votes
1 answer
143 views

I’m currently learning about data structures and algorithms (DSA) by reading the book “Learning JavaScript Data Structures and Algorithms – 2nd Edition” by Loiane Groner. I am implementing the DSAs in ...
Gabriel França's user avatar
2 votes
1 answer
113 views

I am a student studying graph algorithms and learning topological sorting of a Directed Acyclic Graph (DAG). The topological_sort function below is provided in our textbook, and I am not allowed to ...
user30659876's user avatar
Advice
1 vote
4 replies
178 views

I want to learn Data Structures, Algorithms, and Big-O notation from scratch, but there are too many resources online and it’s difficult to determine which ones are trustworthy or widely used by ...
quantumlattice's user avatar
-2 votes
1 answer
78 views

Something called reversed() on an instance of a class of mine, which resulted in the error TypeError: 'HBox' object is not reversible What does it mean for an object to be reversible?
Marnanel Thurman's user avatar
-4 votes
0 answers
45 views

so I was trying to reverse an array by recursion so the code logic is we are swaping right most end value to the left most end. I have implemented logic but the thing is My recursion function retuns ...
Divya priya's user avatar
1 vote
1 answer
80 views

I’m studying red–black trees (CLRS style) and I’m confused about how black-height behaves during RB-INSERT-FIXUP. I quote here that procedure from CLRS: RB-INSERT-FIXUP(T, z) while z.p.color == ...
Sami Barakinston's user avatar
0 votes
1 answer
102 views

I'm working on a small DSA practice problem involving frequency counting, but with a twist. I have a list of tuples where each tuple represents a (category, item). Example: data = [ ("fruit&...
Ridit's user avatar
  • 23
Advice
0 votes
1 replies
43 views

I'm trying to model a generic "capability" or "permission" structure. The part I'm having trouble with is finding the name of the specific data structure. It's not a formal tree, ...
Jim Garrison's user avatar
1 vote
1 answer
221 views

I'm interesting in possible implementation approaches for a quite special variant of a list, with the following requirements: Efficient inverse lookup ("index of"): "give me an index ...
cubuspl42's user avatar
  • 8,631
0 votes
2 answers
167 views

I have a folder containing huge numbers of files in many subfolders, and I want to select the files with a name that matches any of a specified list of patterns (regular expressions). My regular ...
Theodor Zoulias's user avatar
-3 votes
1 answer
196 views

The algorithm I've written for an assignment is closely related to this monotonic stack approach https://www.geeksforgeeks.org/dsa/next-greater-element/ Best case: n pushes → Time complexity: O(n) ...
user29898's user avatar

15 30 50 per page
1
2 3 4 5
2274