Basic data structures and algorithms in python

Basic data structures and algorithms in python Searching algorithms in python Linear search 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 def linear_search(arr, target): for i in range(len(arr)): if arr[i] == target: return i # Return the index if target is found return -1 # Return -1 if the target is not found def main(): arr = [3, 10, 23, 5, 2, 6] target = 5 # Calling the linear_search function result = linear_search(arr, target) # Output the result if result != -1: print(f"Element {target} found at index {result}.") else: print(f"Element {target} not found in the list.") # Calling main to run the program if __name__ == "__main__": main() Time Complexity ...

February 25, 2025 · 6 min · 1105 words · Me

Neovim_customization

Neovim customization Introduction What is neovim? Neovim is a CLI based text editor that can be used to write documentation, write code etc. it has enough features for regulat text editing but may be lacking for the power users in the stock form, which is what we are going to do here. Prerequisites If neovim is not installed it can be installed in the following way in the following linux distors 1 2 sudo apt update -y sudo apt install neovim -y 1 sudo dnf update -y 1 2 sudo pacman -Syu sudo pacman -S neovim If neovim is alreaddy installed and you already have it setup then the following configuration files may be deleted to start neovim from actual scratch. ...

October 30, 2024 · 2 min · 214 words · Me

Linux Ricing

Linux ricing WTF is ricing Ricing came from the car term “Race Inspired Cosmetic Enhancements” it generally means to customize your software experience tailormade to your usage. In this tutorial we are going to use Arch Linux and Hyprland to completely customize you user experience Prereq

October 24, 2024 · 1 min · 46 words · Aum Pauskar

Dualbooting windows and linux

Dual booting arch and win11 Prerequisites Before installing arch we need to do the following things Disk partition We’ll need to make a disk partition in windows 11 before proceeding to make sure both the OS run isolated, this can be done by the following steps Right-click on the Start menu and select Disk Management. Alternatively, you can press Win + X and choose Disk Management from the list. In the Disk Management window, locate the drive you want to partition (usually the C: drive). In my case I’ve installed in D drive on a separate disk Right-click on the drive and select Shrink Volume In the dialog that appears, enter the amount of space to shrink (in MB). This will be the size of the new partition for Arch Linux. Make sure to leave enough space for Windows. In my case I’ve allocated 100 gigs for Arch. Click Shrink. The unallocated space will appear in the Disk Management window. Bios settings Disable Fast Startup Disable secure boot Arch ISO setup Download arch ISO from the official site. Install a tool such as Rufus or Etcher and burn the ISO onto a USB drive. Booting onto Arch Insert the drive into the computer Restart the computer into the BIOS/UEFI/Bootloader menu Select the boot option as the USB drive Installing Arch (under progress) ...

July 7, 2024 · 6 min · 1257 words · Aum Pauskar

MongoDB

MongoDB Introduction NoSQL databases are non-relational databases that are used to store and retrieve data. MongoDB is a popular NoSQL database that is used to store data in the form of documents. Feature SQL (Relational Databases) NoSQL (Non-Relational Databases) Schema Fixed schema Dynamic schema for unstructured data Scalability Vertical scalability (scale-up by adding more powerful CPU, RAM, SSD) Horizontal scalability (scale-out by adding more servers) Complexity Tables with rows and columns, complex queries with JOINs Document, key-value, wide-column, or graph formats, simpler queries Transactions ACID properties (Atomicity, Consistency, Isolation, Durability) for reliable transactions BASE properties (Basically Available, Soft state, Eventual consistency) less strict than ACID Development Model Mature, with established standards More flexible and evolving rapidly Use Cases Well-suited for complex queries and transactions, e.g., banking systems Well-suited for hierarchical data storage, big data solutions, and real-time web applications Data Integrity High, due to ACID compliance Variable, depending on the specific NoSQL system and its configuration Query Language Structured Query Language (SQL) is standardized No standard; queries are based on the specific NoSQL database system (e.g., MongoDB uses BSON) Relationship Handling Efficient handling of relationships between entities Relationships can be handled, but often less efficiently than SQL databases; denormalization is commonly practiced Installation There are two ways of working with a mongoDB database, one is to run it locally on your machine and the other is to use a cloud service like MongoDB Atlas. For this tutorial, we will be using MongoDB with mongosh and compass installed. ...

June 27, 2024 · 4 min · 709 words · Aum Pauskar