You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

2 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/19 08:07:26 by narnaud #+# #+# */
/* Updated: 2022/09/19 08:07:31 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include <exception>
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <time.h>
#include <numeric>
class Span {
std::vector<int> _vec;
unsigned int _capacity;
public:
Span();
Span(unsigned int N);
Span(Span const &sp);
~Span();
Span &operator=(Span const &sp);
void addNumber(int nb);
unsigned int shortestSpan();
unsigned int longestSpan();
void addNRandom(unsigned int N);
void addRange(std::vector<int>::iterator begin, std::vector<int>::iterator end);
};