# Problems

1. **Finding the largest element in the array \[**[**Problem**](https://www.geeksforgeeks.org/problems/largest-element-in-array4009/0)**]**

* Approach 1 \[BruteForce] : Sorting Using in-built sorted function or swapping technique.
* Approach 2 \[Recursive] : Using max variable and then comparing element of array with that.

2. **Finding the second largest element in the array**

* Approach 1 : Used sorting to sort the array then get the largest element and then traverse on reversed array using slicing and if current element of smaller than largest element then return that as second largest element of the array
* Approach 2 : Used two variable and then traverse twice, 1st to get the largest element and in the second loop get the second largest element the same just by checking if its not equal to the largest element
* Approach 3 : Single traversing, using two pointers to get the largest variable and then assign that largest variable to another variable as second largest element and once the current variable and largest is the same check if the current variable is larger than the second variable and if so assign current variable to second largest variable.

3. **Check if array is sorted \[**[**Problem**](https://takeuforward.org/data-structure/check-if-an-array-is-sorted/)**]**
4. **Remove Duplicates in-place from sorted array \[**[**Problem**](https://takeuforward.org/data-structure/remove-duplicates-in-place-from-sorted-array/)**]**


---

# 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://59r.gitbook.io/ml-university/dsa-data-structure-and-algorithms/problems.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.
