silver
So no one will help me by answering my question😔
Alex
Kenny
I've only heared about that, i don't anything
Kushal
it works
E.g 1,1,1,2,3,4 For (int I =0;I<n;I++) { If ( arr[i] < arr[I+1]) .......... It won't work
Alex
yes, check if user array is not empty
infi ptr
Please look at whole code User input array can be anything It can be ascending It can be descending Or not Sorted. We have to code that It's ascending, descending or not Sorted
so we are traversing : check 1: a[1]>a[0] then.... a[i+1]>a[i] till n, if failed in between break and false. and if i==n-1; print true. similary for other case. time complexity o(n)+1 maximum
Anonymous
then >=
infi ptr
then >=
exactly
Gianla.
is C deprecated?
Dima
nope
Dima
and never will be
Stefan
is C deprecated?
not possible but de facto yes
Stefan
c is entering its maintenance period like cobol
Stefan
meaning no new major projects are ever going to be done in c
Stefan
the majority of c application is still in embedded system but even that is being slowly eaten away by c++ and rust
Stefan
its like a 55 years old guy who is about to retire but still work some out
Stefan
think about it, when is it the last time you see a c project/application beside from your uni assignment? I do have to code in C but I would not like to in my OS course
Stefan
but i hate it so much like I had to write a fucking pipe duplex communication module that ended up being a hot fucking mess
Stefan
and this could be immediately improved if i had a oop language in hand
Stefan
people praising c "its so simple and fast!" yaya like i fucking do and when i try to debate, "you are just fucking shit in programming"
Stefan
i have to say about it. people who still use c and promote c today is just most likely a cultist
Roxifλsz 🇱🇹
Cultist
Roxifλsz 🇱🇹
Heh
Gianla.
ok so is better if i learn c++
Pavel
ok so is better if i learn c++
That depends on what you need. If you want to learn C++, then learning C won't give you much profit there. If you want to learn C, then learn C.
Roxifλsz 🇱🇹
Yoh
Nice bio, nigga
That's a hot bio
Roxifλsz 🇱🇹
That's a hot bio
Uh oh, we have a trap lover here
Roxifλsz 🇱🇹
Based faggot
Stefan
Making binary tree is O(n * log n)
nope, if you know it is not pathological it must not be sorted i guess
Stefan
and creating a pathological tree will make it O(n), so still linear
Vlad
and creating a pathological tree will make it O(n), so still linear
I still don't see how it is better than just naive comparision.
Stefan
I still don't see how it is better than just naive comparision.
because the naive comparison encoded to check whether a binary search tree has a valid weak inorder
Björn
/get cppbookguide
Stefan
ok i agree that binary tree is not precise enough, i want to say the one where left < parent & right > parent, aka bst
Stefan
https://www.geeksforgeeks.org/count-inversions-in-an-array-set-2-using-self-balancing-bst/ oh so it also means if inversion = 0/len(arr)
Suicide Liza
hello is here anybody who used open_spiel? i have problem to compile it as static lib does anybody can help?
Alex
I have a question if anyone can help abour function pointers limitations
Asdew
Just ask!
Alex
Okay so basically I have a member variable that is a function pointer and you can use some provided functions to set it to or let it be set to your own via constructors. The issue i noticed is some of the provided functions have a 2nd default parameter so it doesn't want to set it to my member bevaise its type (*)(double, double) instead of (*)(double). How could I set it so it ignores the 2nd parameter if isnt given
Kenny
Can you set the second parameter to a default value?
Kenny
Example: 0 ?
Alex
Example: 0 ?
Thats what it is actually and no dice haha but I think I figured a way to do what I want now
olli
and creating a pathological tree will make it O(n), so still linear
how so? Insertion into a BST is log N and you have to do it N Times
Stefan
how so? Insertion into a BST is log N and you have to do it N Times
yeah just realized i was doing a special case here
Stefan
insert, then switch node to the newly inserted item
olli
c is entering its maintenance period like cobol
I don't agree, the committee is working on C2X, a new revision designed to replace C18 (ISO/IEC 9899:2018) the most recent standard published in June 18. If you care about the TIOBE Index, it even overtook java again and is back at the top https://www.tiobe.com/tiobe-index/
Stefan
https://www.tiobe.com/tiobe-index/
you know tiobe is the most bullshit joke right? they rank languages by keyword searches. this means short and high frequency word even if it is not related to the language itself will ve been counted
Stefan
most of the fundamental software around us is written on C
it doesnt mean c should go popular ever more and it had no conflict for me wishing it should die and rot in the deepest realm of hell
Stefan
pascal and cobol got the same treatment, now is time for c, later java
Stefan
DIE
Alex
C is created initially for system programming
Alex
nowdays is the best choice for it
Dima
I think nothing will replace C. unless kiddos with python and js will get supercomputers and write OS on them lol
Stefan
nowdays is the best choice for it
rust: haha safe system programming go reeeeeeee
Asdew
C is created initially for system programming
I thought C was created so code written once would work everywhere?
Dima
lol!
Mar!o
rust: haha safe system programming go reeeeeeee
When everything is safe it's boring. Also small is still small and has some cool and some shit features.
Stefan
true too
c has nothing to do with portability
Asdew
They are not smart enough to write an OS.
They'll create a canvas on the screen and draw shapes on it.
Mar!o
you know.. import OS;
lmao xD the python VM running on bare metal without an OS
Alex
c has nothing to do with portability
just use python,js whatever.. you don`t have to use C. usually such tasks are more complicated