Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 629 Bytes

File metadata and controls

21 lines (14 loc) · 629 Bytes

Basics in C++

You can find here basic algorithms in C++.

Backtracking

This method is recursive and it is based on 5 functions:

  • int first(int k) - it initialises the new number "k" with 0 ;
  • int next(int k) - increases k and is verified by turn ;
  • int valid(int k) - k is valid <=> conditions ;
  • int is_solution(int k) - final step -> k should be equal to n or less ;
  • void out() - if k meets all of the above, a {1, 2, .., k} string will be printed ;

Graphs

Dynamic programming

Lists

Others

Here I'll put some of my solutions from www.pbinfo.ro. The numebr of the problem will pe specified in the title.