Well, could you write this in C in my program,please? I was trying, but with no success.
Type: Posts; User: milky
Well, could you write this in C in my program,please? I was trying, but with no success.
Yes, you're right. My English is bad and that's the purpose of misunderstanding. I struggled to say the same what you've written in point 3.
My teacher told me that, I must think about some...
Maximum size of any table used in this program must be maximum 4096 bytes (1024*sizeof(int)) - I don't know how to solve it.. The height of tree is maximum 30.
It means that i can use as many...
Ok, so let's say that you have enough memory. Can you show me how the code would look like? Please it's very important to me.
What do you mean?
That's the point! Could you implement it for me? I will be very pleased.
I know that is quite bizzare, but that is requirement.
Oh, another silly mistake. Now it's working, thank you very much. Would you mind to help me with the problem of maximum size of array. What should i do? Array of pointers to some another array? Max...
Oh, silly mistake, thanks. But still not working. Maybe I paste here my input code:
int *tree;
tree = (int*)malloc(1000*sizeof(int));
memset(tree,-1,1000*sizeof(int));
int i;
char...
Sth like that?
int min(int *tree,int i)
{
int miny = tree[i];
while(tree[2*i] != -1)
{
i=2*i;
miny=tree[i];
@tabstop
You're not very helpful at all...
Oh yes, I pasted wrong code, should be:
int max(int *tree,int i)
{
int maxy = tree[i];
if(tree[2*i+1] != -1)
{
maxy=tree[2*i+1];
max(tree,++i);
Hi!
I've got a few problems with implementation BST using an array. I have to use array, where 2i - left child, 2i + 1 - right child - 2/i - parent of i.
Maximum size of any table must be...
But, that code doesn't work for me... How should i use it? Should I add sth?
About your new code. Hmm, I don't get it :p. Is this combination C and Perl? :D How can I put there a numbers? I'm curious why you have used Perl, seeing that only acceptable language is C(or C99)?...
I thought that, if you put your code here, I can use it as want to and where I want to...
Also, I didn't say that this is my code...
Actually, instead of saying: This is a code, which EVOex...
Specs are quite good, but test is large, f.ex:
3
2121231312231 3213213121 4234324
It has to be C or C99.
Oh, sorry, but i forgot about the time. There are simply no any other rules.
Wow, EVOex congratulations!!!
But it's one problem. Time. It's limited to 10s. And sorting in your program takes more than 10s... Maybe, you can optimize your program?
@quazah,
I'm trying to...
Thank you vart.
It's fantastic idea, but input in my program is f.ex:
3
3 1 2
So unfortunately, using EOF isn't a possible solution.
This is what've managed to do:
a[22],i,j,k;
main()
{
for(;i<=*a;)
scanf("%d",a+i++);
for(;j=--i;printf("%d ",a[i]))
It's shorter, it doesn't work and still above 200 chars....
Hi!
My task is to write a program in C, which sorts an array ascending. I have to use as less chars as i can. The program should have about 110 chars(without whitespaces). I can't use qsort.
...
Oh! I figured it out:
corretly:
while(tab[poz] < x && poz<(ile-1))
Thank for your help, i do appreciate it :)
And i've got last question. How to change this program, that it make...
Thank you very much!
It' almost perfect, but it's one problem - with 0.
It doesn't sort array properly, when it loads zero...