Jaaa
Yes i am writing a c++ programme and their is some on my screen so i just wanna can i fix this
Anonymous
why
/warn do not pm, it's against the rules
Hakeem
hello guys, i want to ask a simple question about c++ algorithm, in code i wrote : if (balance > 1 && key < node->left->key), so, in algorithm, is it correct if i write : if(balance > 1 && key < node.left.key)
Hakeem
or do i just need to write back in algorithm the same as the code
Hakeem
ouh forget to say that node is a new node, and left is also a node
Hakeem
key is an int value
Al
bro... node is a pointer or not?
Hakeem
yeah a pointer
Al
you can use only the 1 then
Hakeem
ouhh okayyyy, thank you Al bert
Hakeem
💪🏽💪🏽💪🏽
Al
np
Anonymous
write a c++ program to find the maximum number from the integers array
Anonymous
Anyone can make?
MᏫᎻᎯᎷᎷᎬᎠ
write a c++ program to find the maximum number from the integers array
Make a variable called max with the value 0 For loop through the array and if the current value is bigger than max, assign it to max variable
MᏫᎻᎯᎷᎷᎬᎠ
In each loop
MᏫᎻᎯᎷᎷᎬᎠ
Lool
Anonymous
You make it and send it
Pay me money , I'll make it and send you
olli
write a c++ program to find the maximum number from the integers array
https://en.cppreference.com/w/cpp/algorithm/max_element
Anonymous
Anonymous
how can i have the size of array
MᏫᎻᎯᎷᎷᎬᎠ
https://en.cppreference.com/w/cpp/algorithm/max_element
I'm sure he was asking about an assignment or the algorithm
Henry
how does associativity worl
ברני
Hey.. I need an advice.. I wanted to learn Java script and c# To find a job.. But my friends recommend me to start with C.. I'm almost 3 months on C and it's annoying.. Will it be that bad to ditch it for C#?..
ברני
In my opinion C# is a good language to start also. If you feel that you like it better then I would suggest switching to it.
I just got too confuse with C.. also because my friend thought me wrong.. And it's not really what I'm lookin for a job.. (in my country the industry wants c# developers..) And my friend recommended me to start with C because it's the basic..
Pavel
I just got too confuse with C.. also because my friend thought me wrong.. And it's not really what I'm lookin for a job.. (in my country the industry wants c# developers..) And my friend recommended me to start with C because it's the basic..
Well, knowing some C won't make you worse at C# in the end 😀 Maybe the opposite. Yes, you've spent some time on C-specific things, but now your point of view to the programming won't be one-sided. And it's better C than Pascal (that I started with 😄)
Anonymous
I got a little trouble in copy constructor in c++ can anyone plzzz make me to understand ??
Pavel
I mean, what exactly you don't understand?
Anonymous
Dude like I read the documentation but I didn't get . If the compiler makes the default constructor why we need to make our own ??
Pavel
Default copy constructor
Sometimes the default behavior is not enough. Imagine you're making a custom linked list. Our class contains pointer to it's start. We wan't to copy our list but ups, default constructor copied only the pointer, so we have two lists that points to the same data, it's not only wrong logically but when we destroy one of them the second one will point to the garbage data.
Pavel
So in this case you need to make a custom copy constructor that makes a copy of each element and link them correctly So after copying you will have two correct lists
Anonymous
Ooooo so basically it just copy the address of the lists nd if we make change in one it reflects in the other so we have to make the copy ri8 ...
Anonymous
Thanku brother for making me understand ...means a lot !! ❣️
Pavel
Thanku brother for making me understand ...means a lot !! ❣️
There's a rule of thumb, if you have a non-default destructor then there's a big chance you need a custom copy constructor (and assignment operator, (and move constructor and move assignment operator probably also)). This known as the rule of 3 or the rule of 5. https://en.cppreference.com/w/cpp/language/rule_of_three
Sam
Send it here
Anonymous
Hello
Anonymous
/notes
Zigzag
What is it?
Pavel
What is it?
Someone summoned a list of notes. You can ignore messages from Rose, unless the messages mention you or your messages :)
Hasan Emre
Hello, does anyone know of linked lists?
Hasan Emre
For example, our affiliate list: 10-20-30-40-50-60-70 How do I make this list like this? 40-50-60-70-10-20-30
Igor🇺🇦
Hasan Emre
Root->next = 70 I got it here but I don't know how to get 70
Igor🇺🇦
Root->next = 70 I got it here but I don't know how to get 70
Show us your code. Post what you have here https://pastebin.com/
Igor🇺🇦
The link is broken :(
What does it mean? It's just pastebin.com. Can't you access the site?
Hasan Emre
Turkey also banned think
Hasan Emre
Look at the my code
Hasan Emre
#include <iostream> #include <conio.h> #include <stdlib.h> using namespace std; struct eleman{ int veri; eleman* sonraki; }; eleman* root = new eleman(); /*int a; void sayiOlustur(eleman *ptr){ // Random olarak 10 tane eleman olustur for (int i = 0; i<10; i++) { a=rand(); ptr->veri = a; ptr->sonraki = new eleman; ptr = ptr->sonraki; } ptr->sonraki = NULL; } void degistir(eleman* ptr,int sira){ }*/ void olustur(eleman *ptr) { // Elemanlari 100'den 1000'e 10 elemanli liste olustur. for (int i=1;i<=10;i++) { ptr->veri = i*10; ptr->sonraki = new eleman; ptr = ptr->sonraki; } ptr->sonraki = NULL; } void sonaekle(eleman *ptr) { // eleman eklemek icin son elemani bul while(ptr->sonraki!=NULL) { ptr = ptr->sonraki; } // elemani ekle ptr->sonraki = root->sonraki; ptr->sonraki->sonraki->sonraki->sonraki= NULL; } void yazdir(eleman* ptr){ while(ptr->sonraki != NULL) { cout<<ptr->veri<<endl; ptr = ptr->sonraki; } } main() { olustur(root); sonaekle(root); yazdir(root); }
Hasan Emre
I can do this if the number of list elements is low, but I have difficulty if the number of elements is too high
Hasan Emre
Continuous next next next
Hasan Emre
İt is difficult
Igor🇺🇦
Can try other paste it code? Telegram doesn't format code well and it's hard to understand what's going on. There are many other sites
Hasan Emre
Okey
Igor🇺🇦
Okey
In short you should iterate while your node is not 70 and set its next to node with 30. You just need to store current node during iteration
Hasan Emre
repl.it/@emredblood/Linked-List#main.cpp
Igor🇺🇦
repl.it/@emredblood/Linked-List#main.cpp
And what exact operation do you need to do?
Hasan Emre
Create a list of 10 elements with different integers. Ask the user to enter a sequence number from 1 to 9. Create the inverse (int order) function that divides the list into two from the point where the user entered the sequence number and reassembles it backwards. For example, if the user enters the value 4, the linked list is 4.5.6.7.8.9.10.1.2.3. will be listed as.
Pavel
repl.it/@emredblood/Linked-List#main.cpp
just a suggestion, it's better to write variable names (and preferable comments also) in English
Jaaa
What is wrapped array
Jaaa
If we have give array of -1,4,-6,7,5 does it mean that subaaray are -1,4,6,75 4,-6,7,5-1 -6,7,5,-1,4 ans so on
YVEF
Hi guys. Is there any way to find an start index of subarray within another array using any standard functions? byte* arr1 = new byte[n] { 1, 2, 3, 4 } byte* arr2 = new byte[m] { 3, 4 } => index == 2
Hasan Emre
repl.it/@emredblood/Linked-List#main.cpp
I arranged it. I'm sure you will understand better now
Hasan Emre
The user will determine where to split the list
Anonymous
Hi