public int getDegree(int node) {
		assert (node < N);

		int result = 0;
		switch (getState()) {
		case ARR_ADJ:
			for (int i = 0; i < N; i++) {
				if (arr_adj[node][i] != 0)
					result++;
			}
			break;
		case ARR_INC:
			for (int i = 0; i < M; i++)
				if (arr_inc[node][i] < 0)
					result++;
			break;
		case LIST_ADJ:
			result = list_adj[node].size();
			break;
		}
		return result;
	}