feraranas / ICPC-Algorithmic-Contests

Just for Fun Competitive Programming Drills 👾👽☠️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ICPC Algorithmic Problems -> Exercises for Competitive Programming & Coding Interviews

GENERAL STEPS IN SOLVING A PROBLEM
    First. UNDERSTANDING THE PROBLEM
    1. What is the required result? What are the data? What is the starting point, or the initial conditions? What are the rules? (What are the allowed operations?)
    2. Is it possible to get the result from the data (with or without following the rules)? Do the problem by hand. What steps did you take? Can you write them down?
    3. Is the problem divided into major parts? What are they? How do they fit together (what memory cells do they share)?
    4. Have you assumed conditions about the problem that are not specified? What are they? Do they restrict the generality of the problem? Does this make a difference?
    Second. DEVISING A PLAN
    1. Have you seen it before, or the same problem in a slightly different form?
    2. Do you know a related or previously solved problem that could be useful?
    3. Look at the result. Try to think of a familiar problem that has a similar result.
    4. Here is a problem related to yours and solved before. Could you use it? Could you use part of it? Could you use its method? Can you modify it so you can use it?
    5. Look at the data. Repetitions in data hint at loops in the solution. What are the patterns?
    6. If you cannot solve the proposed problem, try to solve first some related problem. Can you imagine a more accessible related problem? A more general problem? A more special problem? An analogous problem? Can you solve part of the problem? Keep only part of the result and drop the rest: How much can you solve of the modified problem? Can you think of a new rule that would help to solve the problem? Can you restate the operation of the new rule in terms of rules you already have?
    Third. CARRYING OUT THE PLAN
    1. Check each step. Can you see clearly that each step is correct? Have you considered special cases?
    2. Can you check the result? Is the "answer" correct? Can you arrive at the right result, given a reasonable set of data? Given an unreasonable set of data?
    3. Make certain you solution works for "boundary" conditions. Does it work if the data list is empty? Too long? Can you acquire data that results in division by zero (or other nonsense)?
    Fourth. LOOKING BACK
    1. Do you compute an intermediate result that ins't used later? Can you eliminate it to simplify the solution?
    2. Can you derive the result differently? Can you make your solution simpler or more general?
    3. Can you use the solution, or method, for another problem?

Arrays & Hashing

Problem Description Example

Two Pointers

Problem Description Example

Sliding Window

Problem Description Example

Stack

Problem Description Example

Binary Search

Problem Description Example

Linked List

Problem Description Example

Trees

Problem Description Example

Tries

Problem Description Example

Heap / Priority Queue

Problem Description Example

Backtracking

Problem Description Example

Graphs

Problem Description Example

Advanced Graphs

Problem Description Example

Dynamic Programming Graphs

Problem Description Example

Greedy

Problem Description Example

Intervals

Problem Description Example

Math & Geometry

Problem Description Example

Bit Manipulation

Problem Description Example

About

Just for Fun Competitive Programming Drills 👾👽☠️


Languages

Language:Python 86.0%Language:JavaScript 13.5%Language:C++ 0.5%