Just to add a reference to Sieve of Eratosthenes algorithm for finding all prime numbers in range 2-N for any given N. It operates very fast, and can be memory optimized by spending 1 bit per number, meaning that N/8 bytes are required to find all prime numbers up to N.
I suppose that is compile error. Two things are required:
1. DirectoryInfo instead of directoryinfo
2. Refer the class either its full name (System.IO.DirectoryInfo) or put using System.IO; at the beginning of the file.
Not really - sorting the list may cause head node to be changed.
I prefer creating another structure, e.g. called List, which only contains pointer to head element: Node* head;
Then you can pass the List variable (by value) to the sort method, and that will rearrange Node instances into a different sequence, possibly changing the head node too, and List variable will reflect the changes.
Same effect can be obtained with passing reference to head element pointer, e.g. like this: void placeWordsInBuckets(Node **headPtr).
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download