Project Euler #22: Names scores

Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score. For example, …

Linked List Exercise in C++

#include #include using namespace std; struct Node { char _data; Node *_next; Node() { this->_next = 0; this->_data = 0; } Node(char ch) { this->_data = ch; this->_next = 0; } ~Node() { } }; class LinkedList { private: Node *_header; int listCount; public: LinkedList(); ~LinkedList(); Node *getHeader(); void setHeader(Node …

Linked List Exercise in C++

#ifndef _LINKED_LIST_ #define _LINKED_LIST_ #include struct Node{ // Data Link void *data; // Pointers to previous and next Node *next; }; class LinkedList { private: // Keeps count of the number of list elements int listCount; // Keeps track of the head of the list for traversal Node *head; public: …