> For the complete documentation index, see [llms.txt](https://ankit-apdc.gitbook.io/python-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ankit-apdc.gitbook.io/python-1/data-structure/problem-solving-techniques.md).

# Problem Solving Techniques

### Two Pointer Method

Declare two pointers, one is faster (increment by 2) compared to slower (increment by 1)

* Find the centre element of a LinkedList
  * When faster reaches the end node, slower one will be at the mid node
* Check if a LinkedList is cyclic or not
  * If cyclic, then, at one point in time slower and faster pointers will be at the same point

### Binary Search Problems

Using while/for loop or using recursion

<https://medium.com/techie-delight/binary-search-practice-problems-4c856cd9f26c>

### Recursion

{% hint style="success" %}
**FEW DEFINITIONS:**

**Anagram**: A word or phrase that is made by arranging the letters of another word or phrase in a different order
{% endhint %}

## Some Cool Solutions

### Sum of Digits

Mathematical Solution is brilliant: <https://leetcode.com/problems/add-digits/solution/>

### Bitwise Operations in Python

<< and >>

##
