Hello,
I am working on a homework lab in which we have to find all the subsets equal to a given sum from an array of numbers.
For example, an array of 7 numbers (1, 3, 4, 6, 7, 10, 25) with a...
Type: Posts; User: mgracecar
Hello,
I am working on a homework lab in which we have to find all the subsets equal to a given sum from an array of numbers.
For example, an array of 7 numbers (1, 3, 4, 6, 7, 10, 25) with a...
Hello all, so I am doing an assignment that requires me to insert new keys into a Red-Black tree. During this my professor wants us to also update the "odd subtree root ranks" of each node.
The...
No problem. It's partially my fault. I had about a week and a half to do it, but I inconveniently got sick for a few days, had work, and a few personal matters to take care of. It happens. I have a...
Thanks for your help everyone. So I haven't coded in C in a little over a year now, so the code may not look the best.
Here is the code I came up with though....[C] #include <stdio.h> #include...
Ahhh excellent points by all of you. My T.A. hasn't gotten back to me and I have been at work all day so I am just now getting back to this. I will continue to work on it tonight. I see what you guys...
I'm using Dev C personally. I believe the professor is going to be testing it on SSH.
And @rcgldr, thank you for that last post. It didn't even cross my mind on how accurate the degree needed to...
Thanks for the advice rcgldr. However, I forgot to mention that in class he said he forgot to take that off and does not want us to use arctangent or atan2(). I appreciate the idea though. If all...
Hello everyone :),
I'm not really asking a coding question, but more of a concept question for my homework that is baffling me right now.
I will explain it below, but a direct link to my...
Works perfectly.
Thanks a lot for your help. ;)
Well actually I tried the function without the parameter and it was working. I just added the parameter because I realized I need to use it to know how many spots there are in the structure. And...
My function is this....
struct names *open_classes_taken(int *name_count, int *class_count[]);
it returns a structure for me. And it uses an integer that i'll need later which is the first...
Last post on this topic hopefully.
I think I fixed it.
Check this out.
struct names{ char name[20][20];
};
still messing around with it....
but so far this is what I have...
struct names *all = malloc(sizeof(struct names));
if ( (fp = fopen("hw11-data.csv", "r" )) == NULL )
...
Ok, I'm trying this way..
struct names{ char name[20];
};
struct names **all = malloc(sizeof(struct names*));
if ( (fp = fopen("hw11-data.csv", "r" )) == NULL )
yessir, and that was my next idea. But I wasn't sure how I'd implement that. As in, how would I know it's the new line?
for example my function for this piece of code for this so far is this...
...
Hi,
I have an assignment in which one of the requirements is to read a file which has a person's name as well as their classes they have taken.
such as
Jerry,CSE1320,CSE1310...
alright I'm going to fool around with it some more. Thanks for the help
ahh, i never thought of the loop that way. Much easier than what I was trying to do. So I no longer need my if-else statements either.
Quick question though...Why does the realloc need to be inside...
I'm reading in a file line by line. Each line has a name, and a random number of classes.
for example
Jerry,CSE1310,CSE1320,CSE1325
Bob,CSE1105,CSE1310
Barry,CSE1104,CSE1105,CSE1310,CSE1320
...
Sorry about that. I just posted what I changed in the other one. I didn't mean to offend anyone. I won't post the new thread for the same problem either.
And as for Salem...
I'm not sure on...
Sorry about that. Someone else got onto me as well for making 2 different posts.
Anyways for this one...
I was right about the add_and_balance function
I changed it to this..
root =...
I've been working on this for many hours now. Maybe a good night of rest will help clear my head and help me out.
But I'm going to post this here tonight in hope to see something tomorrow that can...
I fixed it. Useless post Haha
Edit
You know what...I think I put in the actual numbers in the array for the function he had. I think he wanted to spot where of the first and last variable. I.E. (0 and Max_lines). Gonna see if...
My professor gave us an assignment to make a binary tree. We're given a file which we store in an array and then sort the numbers in the array least to greatest.
I have done all of that so far...
...