# Industry Standard Algorithms

{% embed url="<https://replit.com/@bgoonz/pure-ds>" %}

{% embed url="<https://replit.com/@bgoonz/Data-Structures-6#main.py>" %}

{% file src="/files/-Mj8p-pPUH661M1v-fx1" %}

{% embed url="<https://replit.com/@bgoonz/main-prac#directed_graph.py>" %}

## Is Subsequence:

```python
def is_subsequence(s, t):
    """
    :type s: str
    :type t: str
    :rtype: bool
    """
    if len(s) > len(t):
        return False
    matched_s = 0
    for char in t:
        if matched_s < len(s) and s[matched_s] == char:
            matched_s += 1
    return matched_s == len(s)
```

## Reverse String:

```python
def reverse(lines):
    return "Reverse order: " + lines[::-1] + "\n" + "Normal Order: " + lines
print(reverse("I am printing a sentence in reverse order"))
print(reverse("printing strings in reverse order using python"))
```

### Implement a function recursively to get the desired Fibonacci sequence value. Your code should have the same input/output as the iterative code in the instructions.

```python
def get_fib(position):

    output = 0
    if(position==0):
        return output

    if(position==1):
        return position
    else:
        output += get_fib(position-1)+get_fib(position-2)
        return output

# Test cases
print get_fib(9)
print get_fib(11)
print get_fib(0)

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://py-v2.gitbook.io/datastructures-in-pytho/practice/supplemental-practice/industry-standard-algorithms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
