|
by: _mario.lat |
last post by:
kruskal:minimum spanning tree. how to do?
I'd like to find the minimum spanning tree with kruskal algorithm.
There is a code (in C++) written?
which contenitor do you suggest (Vector, set, ...)?
How can I do?
Thank you in advance, Mario.
|
by: sugaray |
last post by:
the binary search tree node here contains another structure as it's
data field,
programs did successfully work when data field is int, char, this time
i got stucked, don't know why ? if there's something to do with
dynamic data object ?
thanx for your help.
================== begin of code ==============================
#include <stdio.h>
#include <stdlib.h>
|
by: Mike |
last post by:
Why does this code insert a node into a binary search tree correctly? If I
only inserting going by first digit it works properly but when I try
inserting going by the whole ip and the port number the inserts are totally
out of order.
where
IPAddress is four ints
Node is an IPAddress, portNumber, left pointer and right pointer
Nodeptr is a pointer to a Node
|
by: pyguy |
last post by:
Hi all,
I am running into a conceptual glitch in implementing a simple binary tree class. My insertion and printing (sorting) seems to be ok, but when I search the tree, my find method isn't doing what I thought it should.
Here is the output of running my tests:
>python -i trees.py
**********************************************************************
File "trees.py", line 70, in __main__.BinaryTree.find
Failed example:
|
by: tonokio |
last post by:
I wasn't sure if this was the best place to post since there isn't
really an algorithm section for programming. I was curious that if
you're given a MST tree of G and P is the shortest path between two
nodes s and t. If we increaset the cost of each edge of G by some
amount x, would P still be the shortest path between s and t, because
all the values are incremented by x amount or would it change?
|
|
by: zahit |
last post by:
Hi guys, below there is a c code which caluclates given data repetition in a binary tree.
typedef struct node *tree_pointer;
typedef struct node{
char data;
tree pointer left_child, right_child;
}
int repetition(tree_pointer L, char x){
|
by: FARAECHILIBRU |
last post by:
i'm building a binary tree the problem is when i'm reading from e text file .First i'm sending to tree builder function a empty node and e new node the function return me firt node of a tree, but when i try to built the secund node ,i dont anderstend whay, my program write to my new node and to first tree node;
string readLine(istream& fin)
{
char buff;
// Clear any remaining end of line characters
if(fin.peek()=='\n')
{...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|