Silvestr
just address in virtual memory that previously relates to some data
Anonymous
@SilvestrPredko A I said, the address _can_ be reused if the new allocation point "call to new or malloc, ..." points to the same address. If your question is: Is the memory lost until I restart the computer after I call "delete". Then the answer is no, the freed memory returns to the memory allocation pool and has to be requested again.
Anonymous
Exactly. And this doesn't delete any memory at this address. If you call delete and still read at this location you *can* see your own stuff. The memory doesn't change until a new alloc happends and writes new data at this address.
Anonymous
yes
Anonymous
Exactly
Silvestr
thanks guys)
Anonymous
u r welcome :)
Ritu Raj
Anybody expert in Algorithms?
Ritu Raj
What will be the time complexity of T(n)=T(n-1)+T(n-2)+n
Ritu Raj
Ludovic 'Archivist'
assuming the naive implementation
Anonymous
Anyone to send me a good c compiler
Ибраги́м
Anyone to send me a good c compiler
G - Good C - C C - Compiler
Ludovic 'Archivist'
What will be the time complexity of T(n)=T(n-1)+T(n-2)+n
A smart implementation would be O(n) tho
Anonymous
ultimate kek
Can I get link to download please 🤲
Anonymous
I think linear -> O(n) @ritu_raj_s
Anonymous
Anonymous
It's a website, many people use it
Anonymous
Ritu Raj
I think linear -> O(n) @ritu_raj_s
I don't know why I am getting O(n^2)
Ritu Raj
Can you provide me soln???
Anonymous
@linuxer4fun : what is "a" in O(an) ? I'm not an expert in determining time complexity
BinaryByter
its a coefficient
Anonymous
If you expand it, T(n) = n +sigma i = 1 to i = n i * (n - i) = n + O(n ^ 2) - O(n ^ 3) so should be O(n^3) I think
Ludovic 'Archivist'
I don't know why I am getting O(n^2)
For the naive one: You call for each step n-1 times the thingy + n-2 times it recursively, so you make a factorial complexity. For the linear one, you just have a loop and a store and go increasingly for higher values so it will always be linear to n
Anonymous
@akki: Hmm... perhaps because it is a recursive function which is results as the same or similar to a nested loop. two nested loops have the complexity of O(n²)
Anonymous
@linuxer4fun : If a is a coefficient, then should be the complexity then still be linear O(n)? Just wondering
Ludovic 'Archivist'
Anonymous
its a coefficient
coefficients get ignored
Anonymous
It's common ^^
Ludovic 'Archivist'
linear is always a coefficient
you don't write the coeff normally
Ludovic 'Archivist'
linear is always a coefficient
unless you need to go through the steps twice or thrice explicitly and want to compare on that basis
Anonymous
What will be the time complexity of T(n)=T(n-1)+T(n-2)+n
Depends on the end condition too what is T(0)
Anonymous
@linuxer4fun : Hmm... you just gave me some homework to do :)
Ritu Raj
But for T(n-1)+n
Ritu Raj
I am getting O (n^2)
Ritu Raj
Is it correct or incorrect?
Anonymous
This should be correct
Anonymous
The one you mentioned earlier is different
Ritu Raj
The one you mentioned earlier is different
For the previous one I also think answer is O(n^3)
Ramdev
What the wrong with this ?
BinaryByter
everything.
Ramdev
Why ?
Venu
everything.
😂😂😂
BinaryByter
btw: who is blowing your friend who is in the background?
Ramdev
Plz help not comment
BinaryByter
Plz help not comment
i'm not even going to try helping you
Mihail
i'm not even going to try helping you
Can't be bothered to even try reading that tbh
Mihail
Would be a waste of time
BinaryByter
Can't be bothered to even try reading that tbh
you should, its the perfect "try not to cringe" compilation
BinaryByter
yea
Anonymous
Hello every one
BinaryByter
you mean the slave in the background?
Anonymous
Anonymous
Me as I read that
BinaryByter
xDD
Anonymous
Lel, a few seconds ago our trainee asked me if I could explain him some code in one of our libraries. I came to his desk, he showed me two files full of TMP. Some of them written by me 😆I just said "Uhm.. This is a special topic of C++, you don't need to work on that code, fix some other bugs." - explaining a beginner how TMP code works is like black magic for him
BinaryByter
TMP?
Anonymous
Template meta programming
BinaryByter
my favourite topic
BinaryByter
templates allow for a lot of black magic
BinaryByter
template magic :D
Anonymous
Yee, pretty usefull for some stuff and libs, but absolute overkill for beginners
BinaryByter
xDDD