Search Result

Collapse
6 results in 0.0041 seconds.
Keywords
Members
Tags
recursive
  •  

  • zahit
    started a topic recursive hanoi function with nasm

    recursive hanoi function with nasm

    hi all, i've been trying to develop a recursive hanoi function in intelx86 assembly language. i use nasm to run it. i use this c function as sample

    Code:
    void hanoi_rec(int n_disc, int head, int middle, int tail, int silent){
         if (n_disc == 1){
    	  if(silent != 1)
    	       printf("%d --> %d\n", head, tail);
         }
         else{
    	  hanoi_rec(n_disc -1, head, tail, middle, silent);
    ...
    See more | Go to post

  • Roger Barney
    started a topic Using recursive CTE in stored proc?
    in DB2

    Using recursive CTE in stored proc?

    I have a need to run a recursive CTE within a stored proc, but I can't get it past this: SQL0104N An unexpected token "with" was found following "SET count=count+1; ". Expected tokens may include: "". LINE NUMBER=26.

    My google-fu showed a couple of similar topics, but none with resolution.

    The query functions as expected outside of the stored proc, so I'm hoping that there's some syntactic...
    See more | Go to post

  • rjddude1
    started a topic Which one is better and why?
    in C

    Which one is better and why?

    Is recursive function for calculating Fibonacci series or iterative function is better?
    ITERATIVE:
    Code:
    int fibonacci_iterative(int n)      //Iterative formula for fibonacci series
    {
      int f0 = 0;
      int f1 = 1;
      int i, fn;
      
      if (n == 0)
            return 0;
      if (n == 1)
            return 1;
            
      for(i = 2; i <= n; i++)
      {
        fn =
    ...
    See more | Go to post

  • presencia
    started a topic SIGSEGV on delete[] problem, recursive function calls
    in C

    SIGSEGV on delete[] problem, recursive function calls

    Hi everyone,
    I have written a small program running fine until a Segmentation fault. Using a debugger I have localized the function the fault happens in. The Signal appears during a call to delete[] in the recursive function I have posted below. I have done some C coding before but I am fairly new to C++. I would really appreciate any help. I can't figure out where the problem is.

    The function the SIGSEGV appears in is the following....
    See more | Go to post

  • simple recursive function: display the first n even numbers

    Eg: n = 3 - > 2,4,6.

    Can anyone help me w/ this?

    int even(int n) {
    if ( n==o)
    return (0);
    else
    return( ???) ;

    }

    thx
    See more | Go to post

  • paulnamroud
    started a topic Recursive stored procedure

    Recursive stored procedure

    Hi all,

    I need your help.
    I'm creating a program to display the circuit of Bus by city and stop.

    This is my example and i don't know how to do it:

    I have 3 differents circuits of bus and each circuit can have one or multiple transfer to another circuit.

    So let's say i'm looking for a trajet from City1/Stop1 (source) To City3/Stop11(destinat ion)

    Here's the scenario:...
    See more | Go to post
Working...