Assume i have an initial list of n-2 columns and 2^(n-2) rows, where initially:(adsbygoogle = window.adsbygoogle || []).push({});

all the entries are zero.

i wnt to sort it out that eveantually we'll get a truth table for this.

i.e if we have n-2=2 rows and 4 columns, then:

obvously we have here a jump first we initialise the array to give us everywhere zero, afterwards i need to insert via a loop the entries of 1, i.e in the first column it should be changing the zeros in a[1][1] and a[3][1] i.e we have a jump of two places and in the next column a jump of three places, but i don't know how to write it in the loop condition, any thoughts?Code (Text):

0 0

1 0

0 1

1 1

the exam is tommorow, so your help would be tremendous for my success, thanks in advance.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Sorting a list of zeros and ones.

Loading...

Similar Threads - Sorting list zeros | Date |
---|---|

Need some information about Shell Sort | Apr 24, 2017 |

Generic QuickSort causing StackOverflow? | Apr 15, 2017 |

Recursively sorting an array of strings w/o aux. parameter | Feb 20, 2017 |

Java Problem with Merge Sort Alg Implementation | Feb 19, 2017 |

What's wrong with my sorted linked list algorithm? (Java) | Nov 7, 2009 |

**Physics Forums - The Fusion of Science and Community**