https://lnkd.in/g7YcJVuF A key factor of this book and its associated implementations is that all #algorithms (unless otherwise stated) were designed by us, using the theory of the algorithm in question as a guideline. #datastructures #computerscience #datascience
Ju Rao’s Post
More Relevant Posts
-
"If you can't measure it, you can't improve it." Peter Drucker The language and metric used to illustrate the efficiency of an algorithm is the Big O notation. Big O notation is an important concept in understanding how to solve data structures and algorithms challenges. Real-World Analogy for Big O Notation Let's imagine you are in a big library, and you are looking for a book: 1) If you know exactly the shelf and location of the book, you will just walk to the shelf and get the book. It is the easiest and fastest method and analogous to O(1). This is known as the "constant time". 2) If the exact shelf of the book is unknown to you, you will start searching for the book from the first shelf and then shelf by shelf until you find it. If the book is on the last shelf or isn't found in the library, this means you'll have searched through the whole big library. For the worst-case scenario, if the library has 300 shelves, it implies you have searched through 300 shelves. It is analogous to O(n) and is known as "linear time". 3) If for every shelf you search, you also read through the introduction of the book, in this case more work is done. The amount of work done increases exponentially depending on the number of shelves. This scenario is analogous to O(n2) and is known as "quadratic time". Two important concepts to take note in Big O Notation are time and space complexity. If you don't have a good mastery of Big O Notation, you will go through so much difficulty in developing algorithms. #Codinginterviewprep #BigONotation #RealWorldAnalogy #TimeComplexity #SpaceComplexity #Algorithms #DataStructures
To view or add a comment, sign in
-
𝗖𝗔𝗣 𝗧𝗵𝗲𝗼𝗿𝗲𝗺: 𝗖𝗼𝗻𝘀𝗶𝘀𝘁𝗲𝗻𝗰𝘆 𝘃𝘀 𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆 𝘃𝘀 𝗣𝗮𝗿𝘁𝗶𝘁𝗶𝗼𝗻 𝗧𝗼𝗹𝗲𝗿𝗮𝗻𝗰𝗲𝗅𝗅 Ever wondered why some distributed systems handle data differently? Let's unravel the mystery of CAP Theorem - the three pillars shaping the landscape: Consistency, Availability, and Partition Tolerance. 𝗖𝗼𝗻𝘀𝗶𝘀𝘁𝗲𝗻𝗰𝘆: Ensuring all nodes in a system have the same data at the same time. It's like synchronized dancing where everyone follows the same steps - a challenge but key for accurate results. 𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗶𝗹𝗶𝘁𝘆: Keeping the system operational and responsive even in the face of failures. Picture it as a 24/7 diner that never closes its doors, always ready to serve up data at a moment's notice. 𝗣𝗮𝗿𝘁𝗶𝘁𝗶𝗼𝗻 𝗧𝗼𝗹𝗲𝗿𝗮𝗻𝗰𝗲: Dealing with network failures or communication breakdowns without compromising the system's functionality. Think of it as ensuring smooth communication even when the internet throws a curveball. CAP Theorem serves as our guiding star in the vast cosmos of distributed systems, reminding us of the delicate dance between Consistency, Availability, and Partition Tolerance. Embrace the journey, and let's craft robust systems together! 𝗖𝗵𝗲𝗰𝗸𝗼𝘂𝘁 𝘁𝗵𝗲 𝗮𝘁𝘁𝗮𝗰𝗵𝗲𝗱 𝗖𝗿𝗼𝘂𝘀𝗲𝗹 𝗳𝗼𝗿 𝗰𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗰𝗼𝗺𝗽𝗮𝗿𝗶𝘀𝗶𝗼𝗻 𝗰𝗵𝗮𝗿𝘁 𝗯𝗲𝘁𝘄𝗲𝗲𝗻 𝗯𝗼𝘁𝗵. 𝗖𝗿𝗮𝗰𝗸 𝗧𝗲𝗰𝗵 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝘀 𝗮𝘁 𝗠𝗔𝗔𝗡𝗚 𝗮𝗻𝗱 𝗧𝗼𝗽 𝗣𝗿𝗼𝗱𝘂𝗰𝘁 𝗯𝗮𝘀𝗲𝗱 𝗰𝗼𝗺𝗽𝗮𝗻𝗶𝗲𝘀 - Learn Data Structures, Algorithms & Problem-solving techniques - Domain Specialization in Data Science, Machine Learning & AI - System Design Preparation (HLD + LLD) Follow Logicmojo Academy for more such posts. #dsa #database #searching #algorithms
To view or add a comment, sign in
-
Stack-based Algorithms: Stacks in DFS and Backtracking #algorithms #apalgorithms #stack #dfs #backtracking #dfsalgo #algorithmmastery #algorithmupdates #algorithmicthinking #algotrading https://lnkd.in/gYnkWrDF
Stack-based Algorithms: Stacks in DFS and Backtracking — APalgorithm
apalgorithm.com
To view or add a comment, sign in
-
Our latest paper about the mlscorecheck package (https://lnkd.in/d-yYQ8vF) enabling the consistency testing of reported machine learning performance scores is freely available at https://lnkd.in/dDS-bx3M
GitHub - FalseNegativeLab/mlscorecheck: Testing the consistency of binary classification performance scores reported in papers
github.com
To view or add a comment, sign in
-
🚀 **Understanding Algorithm Efficiency: Why Ignore Constant Factors?** 🚀 In the world of computer science, understanding how algorithms perform as data grows is crucial. Recently, I've delved into the concept of algorithm complexity and why we often ignore constant factors. Here's a concise summary of what I've learned: ### **Key Takeaways:** 1. **Linear Search Basics**: - Linear search checks each item in a list one by one until it finds the target value or reaches the end. - **Best case**: The value is at the start (O(1)). - **Worst case**: The value is at the end or not present (O(N)). - **Average case**: Typically finds the value in the middle (O(N/2)). 2. **Why Ignore Constant Factors?**: - **Simplicity**: Constant factors (like 0.5 in O(N/2)) are less significant as the size of the data (N) grows. - **General Behavior**: We focus on the overall trend (O(N), O(log N), etc.) rather than exact counts. This helps us understand how the algorithm scales. - **Comparison**: Ignoring constants allows easier comparison between algorithms. For example, O(N) vs. O(N^2) clearly shows which grows faster as data increases. 3. **Practical Example**: - **Linear Search**: Average case is O(N/2), but we simplify to O(N) to highlight the linear growth. - **Binary Search**: Much faster with O(log N) due to halving the data set each step. ### **Conclusion**: Understanding algorithm efficiency by focusing on Big O notation and ignoring constant factors provides a clearer picture of performance at scale. This approach helps in choosing the right algorithm for large data sets, ensuring optimal performance. 🔍 **Pro Tip**: Always consider the general behavior of your algorithms for better decision-making and efficiency. --- #Algorithms #BigO #ComputerScience #Programming #Efficiency #DataStructures #LearningJourney --- Feel free to share your thoughts or experiences with algorithm efficiency! 💡
To view or add a comment, sign in
-
30 days of Algorithm and data structure Day 2! Understanding Linear Time Complexity (O(n)) in Algorithms and Data Structures When designing efficient algorithms and working with data structures, one of the most important concepts to understand is "time complexity". Today, let's focus on "Linear Time Complexity", commonly referred to as O(n). What is Linear Time Complexity? Linear time complexity, denoted as O(n), indicates that the running time of an algorithm increases linearly with the size of the input data. In simpler terms, if the input size doubles, the time it takes for the algorithm to complete will also double. This is because each operation or step in the algorithm typically depends on the size of the input. Real-World Example of O(n) Imagine you have a list of `n` numbers, and you want to find the maximum value in that list. The most straightforward approach would involve checking each number one by one to find the maximum: In this example, we iterate through the entire list once. Therefore, the time complexity is O(n) because each element must be examined to determine the maximum value. Common Algorithms with Linear Time Complexity Several common algorithms and operations exhibit linear time complexity, including: - Searching algorithms- like linear search, where each element is checked one by one. - Simple loops- that iterate over all elements in a list, array, or collection. - Basic operations-such as summing all elements, finding minimum/maximum, or counting occurrences. Why is Linear Time Complexity Important? Algorithms with O(n) complexity is considered efficient and scalable for many real-world problems. They strike a good balance between simplicity and speed, making them suitable for scenarios where the input size is relatively large but manageable. Linear time complexity is also a great benchmark for comparing more complex algorithms. Understanding time complexity is fundamental to writing efficient code, and linear time complexity (O(n)) is a common target for optimizing algorithms. It offers a good balance of simplicity and efficiency, making it a preferred choice in many scenarios. Next time you design an algorithm, aim for linear time wherever possible to ensure scalability and performance! #Programming #Algorithms #DataStructures #Tech #SoftwareDevelopment #BigO #Optimization #LinkedInLearning
To view or add a comment, sign in
-
We can also use: Feature selection or dimensionality reduction techniques like PCA to reduce the feature space. Approximate SVM methods such as SGD SVM or LIBLINEAR for faster training on large datasets. Parallelization and distributed computing frameworks like Spark MLlib or Dask to handle data in parallel. Incremental training to process data in smaller batches, reducing memory usage. Amazing read by Karun Thankachan
𝗗𝗮𝘁𝗮 𝗦𝗰𝗶𝗲𝗻𝗰𝗲 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻: If you’re training an SVM on a very large dataset, what modifications would you use to improve computational efficiency? A few methods are - 𝗨𝘁𝗶𝗹𝗶𝘇𝗶𝗻𝗴 𝗗𝗶𝘀𝘁𝗿𝗶𝗯𝘂𝘁𝗲𝗱 𝗖𝗼𝗺𝗽𝘂𝘁𝗲 For very large datasets, distributed SVMs that parallelize across multiple processors or nodes can handle large-scale data more effectively. e.g. Apache Spark’s MLlib 𝗨𝘀𝗶𝗻𝗴 𝗮 𝗞𝗲𝗿𝗻𝗲𝗹 𝗔𝗽𝗽𝗿𝗼𝘅𝗶𝗺𝗮𝘁𝗶𝗼𝗻 Linear SVMs assume a linear boundary, and these scale linearly with data. But if a nonlinear decision boundary is needed (which scales non-linearly), you could use techniques like kernel approximation to approximate the RBF or polynomial kernels without actually performing expensive kernel computations. 𝗦𝘂𝗯𝘀𝗮𝗺𝗽𝗹𝗶𝗻𝗴 𝘁𝗵𝗲 𝗗𝗮𝘁𝗮 SVM, which aims to maximize margin between support vectors, so you can't resort to regular sampling as you may lose the support vectors. However, Core-set selection techniques aim to find a smaller set of representative points that approximate the decision boundary, allowing the SVM to be trained on fewer points without sacrificing too much accuracy. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁 your answer below! 𝗥𝗲𝗽𝗼𝘀𝘁 with comments to grow your own network! 𝗟𝗶𝗸𝗲 for more such content. Follow Karun Thankachan for everything DS/ML (IMG: https://lnkd.in/gagjqQvu)
To view or add a comment, sign in
-
Revisited an old classic on HNSW - https://lnkd.in/gE5KDabA. The Hierarchical Navigable Small World (HNSW) algorithm, a standard in vector databases, optimizes approximate nearest-neighbor searches using a multi-layered graph. Each layer links points with varying granularity, enabling efficient top-down, greedy searches to locate the nearest neighbors faster than methods like LSH or product quantization. This technique is crucial in powering Retrieval Augmented Generation (RAG) workflows.
Transaction / Regular Paper Title
arxiv.org
To view or add a comment, sign in
-
💡 DSA Day 3: Exploring Primitive, Linear, and Non-linear Data Structures! 💡 Today, let's delve into the diverse world of data structures in Data Structures and Algorithms. Data structures play a critical role in organizing and managing data efficiently, enhancing the performance and scalability of software systems. Here are the different categories of data structures we'll be exploring: 1️⃣ 𝗣𝗿𝗶𝗺𝗶𝘁𝗶𝘃𝗲 𝗗𝗮𝘁𝗮 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝘀: 𝗜𝗻𝘁𝗲𝗴𝗲𝗿: Represents whole numbers without decimal points. 𝗙𝗹𝗼𝗮𝘁: Represents numbers with decimal points. 𝗖𝗵𝗮𝗿𝗮𝗰𝘁𝗲𝗿: Represents single characters. 𝗕𝗼𝗼𝗹𝗲𝗮𝗻: Represents true or false values. 2️⃣ 𝗟𝗶𝗻𝗲𝗮𝗿 𝗗𝗮𝘁𝗮 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝘀: 𝗔𝗿𝗿𝗮𝘆𝘀: Stores elements of the same type in contiguous memory locations. 𝗟𝗶𝗻𝗸𝗲𝗱 𝗟𝗶𝘀𝘁𝘀: Consists of nodes where each node contains data and a pointer to the next node in the sequence. 𝗦𝘁𝗮𝗰𝗸𝘀: Follows the Last-In-First-Out (LIFO) principle for element addition and removal. 𝗤𝘂𝗲𝘂𝗲𝘀: Follows the First-In-First-Out (FIFO) principle for element addition and removal. 3️⃣ 𝗡𝗼𝗻-𝗹𝗶𝗻𝗲𝗮𝗿 𝗗𝗮𝘁𝗮 𝗦𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝘀: 𝗧𝗿𝗲𝗲𝘀: Hierarchical data structures with nodes connected by edges, including Binary Trees, Binary Search Trees, AVL Trees, and more. 𝗚𝗿𝗮𝗽𝗵𝘀: Consists of vertices (nodes) connected by edges, representing relationships between entities. Understanding these data structures and their categories is crucial for designing efficient algorithms and solving complex problems in software development. Stay tuned for more insights into the world of DSA! 🚀💻 #DataStructures #Algorithms #DataStructuresExploration #TechLearning #DSA #DSADay3
To view or add a comment, sign in
-
🌟 Transforming Data Extraction: Leveraging LLMs Beyond Retrieval 🌟 #LLMs excel not just in sifting through data but in the nuanced task of #InformationExtraction. The most straightforward approach? Prompting. Embed a document within the prompt, request specific data, and let the LLM do the heavy lifting. 🚀 #OpenAI’s advancement with #JSON responses streamlines this by allowing us to simply parse structured outcomes without manually reviewing LLM replies. Not keen on prompt wizardry? Then consider function calls, a hybrid of application logic and LLM reasoning. With a well-defined interface, we can direct LLMs to trigger actions based on data found, like flagging an email address within a text. We see this in action with systems like Fructose, Instruct, or #Langchain’s extraction feature, which facilitate these function calls, even in complex nested structures. But what about uncharted territories without a predefined schema? Enter #TnTLLM—a two-phased titan combining Taxonomy Generation and LLM-Augmented Text Classification. It crafts a taxonomy through document summarization, which then trains a potent classification model. And the innovation doesn’t end there. Meet #GLiNER, a generalist named entity recognition model that outshines LLMs in pinpointing precise entities within text. As we pivot to #MultiModalLLMs, it's clear that traditional benchmarks like the F1 score need reinventing. That’s why the #ANLS* metric is becoming a cornerstone for tasks where #LLMs interact with both text and images without traditional annotations. #DataScience #ArtificialIntelligence #MachineLearning #NaturalLanguageProcessing #NamedEntityRecognition #TextClassification #TechInnovation #AIResearch #HamzaAliKhalid #MoonSys #MoonSysTechnology
To view or add a comment, sign in