I'm still a little fuzzy, but your point that if you want to change a value, then it must be pointed to makes it much clearer. Thanks a lot!
Type: Posts; User: sybariticak47
I'm still a little fuzzy, but your point that if you want to change a value, then it must be pointed to makes it much clearer. Thanks a lot!
Thanks for responding, but I'm still a little confused. Are you saying that with single inderection that the address the pointer holds is not changed when I do something like: ptr=new...
Hi! I've been trying to code a binary search tree. I had a implementation in a book and it worked, but it used a double pointer (**ptr). Although I think I understand how it works, I tried to make...
Hi, I've made a program that solves the game text twist (a word game). I found a list of words online but some of the words aren't actually words at all. I was wondering if there was a way to...
Wow I didn't know that you could optimize your compiler! My program runs in 0.55secs now! Do you know if training sites like acm and usaco do this as well? Thanks a bunch.
I think I my is optimized. It loops while the there is change (if(!changed) break;) and it doesn't check already sorted elements (D_C--). I'm more concerned with why converting the bubble sort into a...
Hi, I was thinking of making a library of different types of sorts(as I had discovered that I could make my own libraries),but I ran into a problem with the
bubble sort. If I write bubble sort...
Your code compares the values, but it doesn't sort them. How do you sort the stuctures?
Hi! I'm trying to figure out how to sort stuctures according to a float value called v. It almost works, but I don't completely understand it. If someone could help that would be great!
...
Thanks for the help
yeah they are two separate codes. So it only fill the first element?
Hi! I've seen in some books notation like :
a[14]={0};
char a[28]={'#'}
What does this do? Thanks!
Thanks a bunch Daved. I didn't see that.
the sample is:
4 50 18
3
4
6
8
14
15
16
ok
this is my whole code
This is a relatively famous problem: Barn repair
It was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many...
C (1 <= C <= S)
The user inputs the values of m, s, c.
cin >> m >> s >> c;
Hi! I've got a problem with my code. Everytime I run my program, I get an error message that I think has to do with array indexing, but I can't figure it out. This is the code that causing trouble...
Hi! I was wondering if there was a more effective way to recognize each digit of a given integer. Given an integer called name, this is what I got.
float name, a;
name= 4734;
int...
Never mind. If it's a good break it will repeat; therefore, I made it so that if the break is larger than the string, the break equals the string. Thanks again!!
It's weird I found some of those mistakes and it worked out ok with some of the large cases I presented it with but when I presented it with: "rwrbbw" it said that the largest break was the third...
Thanks so much. It actually works!! I'm finally done with that problem! Thanks again nvoigt.
The figures were even screwed up too. Wow.
sybariticak47
I've been working on this problem for quite a while. Everytime I try to change the code to make it work, I run into more and more problems. Anyway this is the problem:
Broken Necklace
You have a...
Here's the program I've been working on:
Broken Necklace
You have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random....