Search:

Type: Posts; User: ipsilante

Search: Search took 0.00 seconds.

  1. Thank you! I know !while(feof) is considered a...

    Thank you! I know !while(feof) is considered a bad practice, so your solution is way more elegant. But I still have the same problem, if I search for a specific job using linear search in a text file...
  2. Linear search not working for large data set

    I have a text file of the form:
    number string

    I want to be able to search for a code using binary search, look up a specific name using linear search and print all names that start with a...
  3. Thank you for the reply, however if I do this: ...

    Thank you for the reply, however if I do this:


    for (int a = 0; a < 3; ++a)
    for (int b = a + 1; b < 4; ++b)
    for (int c = b + 1; c < 5; ++c)
    printf("%d%d%d\n", 2*a, 2*b, 2*c);

    ...
  4. Generate all 10-digit phone numbers - backtracking

    I need to generate all 10-digit telephone numbers which start with 0721 and have 3 distinct even digits (not counting the first 4). I know I should be using backtracking and I think I got the math...
  5. Replies
    6
    Views
    5,227

    UPDATE: I've updated the code again, I'm getting...

    UPDATE: I've updated the code again, I'm getting output that adds to the target sum. Still have 2 problems: it uses a value more times than it appears in the original and it doesn't print all unique...
  6. Replies
    6
    Views
    5,227

    Could you please explain this a bit more? Why is...

    Could you please explain this a bit more? Why is it garbage data, shouldn't I be processing the data from the array of coins to check each value? I made some progress with the code, but getting an...
  7. Replies
    6
    Views
    5,227

    I'm getting a segmentation fault now, this is...

    I'm getting a segmentation fault now, this is what my debugger says:
    Program received signal SIGSEGV, Segmentation fault.
    0x0000555555555178 in back (step=<error reading variable: Cannot access...
  8. Replies
    6
    Views
    5,227

    Sum of subsets backtracking

    I'm trying to implement a version of subset sum using backtracking. From an array of coins, I want to obtain a certain sum. this is my code so far but I'm getting no output:


    #include <stdio.h>...
  9. Replies
    1
    Views
    3,239

    Printing ordered data from file

    I have the following task:
    Implement a program that reads lines of data from a file specified as a command-line argument, having the following format:


    {ana12 : mere}
    {andrew : -}
    {john : ...
  10. Replies
    3
    Views
    3,595

    Desired output would be: 6.12 2.13 9.33 1.2 // 7...

    Desired output would be:
    6.12 2.13 9.33 1.2 // 7 digits in total in the decimal part
    3.14 5.221 0.55 4.77 // 9 digits in total in the decimal part
    0.99 4.22 3.56 8.95 3.125 // 11 digits in total...
  11. Replies
    3
    Views
    3,595

    How to sort data in .txt file

    I have a .txt file with floating point values on each line:
    3.14 5.221 0.55 4.77
    6.12 2.13 9.33 1.2
    0.99 4.22 3.56 8.95 3.125
    9.0575 4.897542 120.2324 55.555


    #include <stdio.h>...
Results 1 to 11 of 11