All Questions
2,850
questions
-1
votes
0
answers
17
views
how to find the Minimum Spanning Tree on graph like that? [closed]
enter image description here
i think that this quastion have a liniar complexity solution ; i will addd the algorithm of procedure Prim(G, w):
input: גרף G עם קבוצת צמתים V וקבוצת קשתות E, פונקציית ...
5
votes
1
answer
108
views
Minimal path on weighted tree query
Given a weighted tree with n vertices. there are q queries and for each query, you are given integers (u,k). find number of vertices v such that the smallest edge on the route from u to v is equal to ...
4
votes
2
answers
269
views
Minimum edges to form path with length L
I came across this problem.
Given a weighted tree T, find the minimum number of edges to form a simple path (no duplicate vertices or edges) of weight (sum of weights of edges) exactly L.
More ...
1
vote
1
answer
47
views
Understanding Disk Reads and Cache Misses for B-tree and BST Queries
I am trying to understand how disk reads are handled when performing query operations on B-trees and have TWO questions.
I have the following B-tree structure:
[10, 20]
/ | ...
0
votes
1
answer
46
views
Spanning disjoint trees in directed bipartite graphs
Assume we have a directed bipartite graph G with two partitions, A and B. All the edges are assumed to start from A and end in B . Assume that every vertex has at least one adjacent edge. I want to ...
1
vote
0
answers
67
views
Cartesian tree index
input
The first line of the input file contains an integer number N -- the number of pairs you should build cartesian tree out of (1 ≤ N ≤ 50 000). The following N lines contain two numbers each -- ...
1
vote
1
answer
26
views
How do pre-order and post-order lists for a tree support efficient ancestor queries?
I'm reading a paper titled "Practical Algorithms for Incremental Software Development Environments", by Tim A. Wagner. In chapter three, he talks about a tree data structure that represents ...
1
vote
1
answer
54
views
Clique Connect: minimum spanning tree (Kruskal vs. Prim)
Problem Statement
You are given a weighted undirected graph G with N vertices, numbered 1 to N. Initially, G has no edges.
You will perform M operations to add edges to G. The i-th operation (1≤i≤M) ...
0
votes
0
answers
33
views
Design a efficent price notification system
I am trying to create a notification system where users can set
price point notification: user notified when price reach x$
change notification: notify the userswhen the price change every
x$
I am ...
0
votes
1
answer
38
views
Populating N-ary Tree with Depth first then left to right constraint
I'm trying to implement a function that populates the n-ary tree with these top two priorities (in this order): 1. Insert at the maximum possible depth. 2. Insert from left to right, as such an ...
0
votes
1
answer
95
views
Count all odd paths in a tree
My task is, given an acyclic non-direct graph, to count the pairs of nodes connected by an odd number of edges.
My question is why should I start searching the graph from those vertices which have odd ...
0
votes
2
answers
77
views
Algorithm for enumerating unique ways to remove leaves from a tree?
I am looking at this challenge:
Consider a tree graph, where each vertex can be removed only if it is a leaf node. A parent node may have multiple children nodes. A root node is given, which, as ...
2
votes
1
answer
83
views
Find the missing value in a complete BST populated by each number from 1 to 2^K, where K is the number of levels
Let K be the number of levels in a binary search tree. Hence, the maximum number of nodes I can have is (2^K)-1. I have a complete binary tree (i.e., to say that each level is completely filled), ...
0
votes
1
answer
113
views
Constructing a tree data structure recursively, from an array of strings that maintain an order of precedence
I am currently facing an issue where I have an array of different strings, each representing some part of a logical and/or comparison operation, for example: ['Name', '=', 'John', 'and', 'LastName', '!...
2
votes
1
answer
79
views
Implementing a Tree of Life Visualization in JavaFX with Clade and Hierarchy Determination
I'm working on a project to visualize the Tree of Life using JavaFX, based on a dataset from Kaggle: Tree of Life Dataset.
The dataset organizes species into a hierarchical tree structure, including ...