Carbon nanomaterials for non-volatile memories