Pls, in terms of asymptotic function :(
This is really hard to understand for me!
I guessed was (n^2) when the tree depth is same or more than 3, and (n) when the depth is less then 3
Type: Posts; User: Jacopo
Pls, in terms of asymptotic function :(
This is really hard to understand for me!
I guessed was (n^2) when the tree depth is same or more than 3, and (n) when the depth is less then 3
you are right, but my reasoning remains:D
This is impressive. So it's correct to ignore the work of AddToTail? Maybe not.. then, how much is the complexity of FUNCTION2?
Because < 3 and > 3 are the cases where "AddToHead" function doesn't run. So, it's like the code does a simply visit of tree, therefore its complexity is n, right?
When, instead, the depth is = 3,...
Ok, thanks for your answer. Somebody else? :(
Hello guys,
Which are the asymptotic complexity of this functions?
Function(T) /* T is a Binary Search Tree */
L.Head = NULL /* L is a new empty list of integers */
...
Thanks for all this replies. I'll must learn to use a debugger!
[x] and [y] are only two pointers that I use for scan the tree. I need the [y] pointer because when [x] exits from the while-loop it will be ever a sentinel node ( = null node) but I need instead the...
Hello again!
My hard work given me another big issue!
So, I'm doing my Insert function for my red and black Binary Search Tree. My function is: ([n] is node to insert, [y] is pointer that points...
Did it! I will needed a lot of practice to understand completely this argument..
Ohhh I get it!:eek::eek: Thank you!
At this point, I would like to know for what purposes (or into what Abstract Data Type) double pointers are most used.:o
I understood that when the function changes the value of pointer (and not the value witch the pointer points..), we should be use a double pointer. This because the function works on a "copy" of...
A week lost for this..Thank you so much sir!:rolleyes: I love this place!
Hello guys, sorry for this horrible title. I have a big problem.
I created my first personal Generic Singly Linked List. This is code (in italian Lista = List):
typedef struct Node {
void...
I'll do it!
Thank you so much!
mh, but the pointer "match" would be always NULL for each call of function, right? So for each call of Search the if condition will be always false and return will be always NULL as well..
EDIT: Ok,...
Hi again guys,
I'm back with another question, this time concerning tree structures.
My tree is a binary tree and the nodes are struct as follows:
struct Node {
int info;
struct Node...
Yeah I was writing this right now! :D
Thanks to all!
So, this code works but my last doubt...is this the best way to initialize an struct (or this type of struct)?
#include <stdio.h>#include...
Ok, I have tried to rewrite my code with the malloc function but the result not change..Where am I doing wrong?
#include <stdio.h>#include <stdlib.h>
struct Element {
int info;
...
mh, can you show me an example?
How? :confused:
Thanks for reply me.
I'm able to use malloc function to make dynamic array, but how can I use malloc to initialize struct?
Hello everyone,
I'm new entry here, my name is Jacopo, from Italy.
I'm trying study c language and I have write a code to make a list but now I need some help for this.
So, this is not exactly my...