Data Structures Practice
"Be it items in a store,books in a library, or notes in a bank, the moment they become more than handful, we start organizing them in a sequence. It is natural that when we started programming data, it makes us ponder over the question of the problem of maintaining data in an orderly fashion."
Lists
- Sum of List Elements: Write a Python function to calculate the sum of all elements in a given list.
- Reverse a List: Write a Python function to reverse the order of elements in a given list.
- Find Maximum Element: Write a Python function to find the maximum element in a given list.
- Check if Element Exists: Write a Python function to check if a specific element exists in a given list.
- Merge Two Lists: Write a Python function to merge two lists into a single list.
- Remove Duplicates: Write a Python function to remove duplicates from a given list.
- Find Index of Element: Write a Python function to find the index of a specific element in a given list.
- Sort List in Ascending Order: Write a Python function to sort a list in ascending order.
- Sort Names according to their lengthWrite a Python program to sort a list of names based on their length in ascending order. If two names have the same length, maintain their original order.
- Find Second Largest Element: Write a Python function to find the second-largest element in a given list.
- Insert Element at Specific Position: Write a Python function to insert an element at a specific position in a given list.