A bitmap? mind showing me what that is? im thinkin pixels :S
Type: Posts; User: nefsan
A bitmap? mind showing me what that is? im thinkin pixels :S
Ok well since assignment deadline has passed i think it is safe to share my code. A brute force approach which no doubt takes awhile to calculate with large humbles. I have a friend's code one which...
Now try it with test 5 tell me what you get.
The 48655th humble number is :2104219593
Input data took 1286 seconds to calculate
running on a laptop 64bit 2.4 core2duo. damm ^^ 13mins . I should jsut tell Mr Teacher to get a fast...
i have one more test to add, my version is incapable of processing this.takes about 30mins+ and wring ans.Does your one work with this data?
Test 5 100 48655
4013 4019 4021 4027 4049 4051 4057...
scroll up, anduril462's posts are basically what i did.
ok great it got it working!!! :D takes 108 seconds though. hmph thanks for the help. i need to get a faster algo.
ok here is the implementation what you said.It crashes though
int humbleTest(long num){//test if a number is humble or not
int i;
long n;
n = num;
ok my program did look messy cleaned it up a bit. But im not sure i understand how that algo will find the 'kth' number in the sequence. I think the problem is the findhumble function is incapable of...
yes you are right, must have accidentally left it that way while im troubleshooting. I am passing in a long int into my humble test so it must be a long. doesnt affect the situation though :S
Ok so i have been coding this problem.The problem ">
For a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set...
yeah ithink i got it.thnx guys!
i understand all that but what i dont get it how to put the words into the linked list
i know this is a bit cubersome but here it is.it runs and compiles but there is nothing in my start list.i dont...
i use dynamic storage maloc
i have a function that created the node
Nodeptr makenode(char string[]){
Nodeptr str=(Nodeptr)malloc(sizeof(Node));
...
so i have a funtion to read words and put thm all in lowercas leteering.how do i insert the wordsv into a link list ?i have declared the link list and wrote a function to add the words in place.i jus...
well i made a struct for the nodeptr
typedef struct node{
char word[20];
int count;
struct node *next;
...
oky the problem is that i need to read a passage and store the words in a linked list.i also need to check and see which words repeat and keep count how muhc times the word is repeted.i have already...
okay ive gotten some errors worked out so far but my programs crashes but no errors in the compiler.this is my entire program.nneeds to read from a file though.please tell me what my errors can be
...
okay i can make nodes jsut fine using numbers but i seem to be getting problems using toher data such as strings.the rest of the program works fine just this part crashes
typedef struct...
how cool i solved my own problem.how i had it i was comparing it with the same value i read so it would never sort.i needed to compare it with it's predecessor so
k=n-1;
lol so simple hehe yay.tnx...
correction
//how i call it
fscanf(in,"%d",&temp);
while(temp!=-1){
type[i].accnum=temp;
fscanf(in,"%lf %s...
okay im supposed to read from a file and store data in a struct array ,but i must insert in place at the time of reading.i have sucessfully read from the file just my insertion function needs some...
wont one edit the value(&) and permanenlty change it wherease the other jsut copies and uses the value. im thinking the same as passing to functions here
hey i got to write a program which stores randoms numbers in an array use insertion sort and selection sort and time both of them witht the lcock fnction to see which is faster.how do i use the clock...
SURE HERE IS THE CODE it took some adjustments in the sum function simple stufff but it drained my brain.lol!
#include<stdio.h>
#include<stdlib.h>
typedef struct node{
int num;