<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: VICTOR MAINA</title>
    <description>The latest articles on DEV Community by VICTOR MAINA (@victormaina001).</description>
    <link>https://dev.to/victormaina001</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F931054%2Fdcb40a88-fa5b-4f6b-b9d2-934d8e5e7932.jpg</url>
      <title>DEV Community: VICTOR MAINA</title>
      <link>https://dev.to/victormaina001</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/victormaina001"/>
    <language>en</language>
    <item>
      <title>Introduction to Python for Data Engineering</title>
      <dc:creator>VICTOR MAINA</dc:creator>
      <pubDate>Thu, 29 Sep 2022 06:23:21 +0000</pubDate>
      <link>https://dev.to/victormaina001/introduction-to-python-for-data-engineering-53ap</link>
      <guid>https://dev.to/victormaina001/introduction-to-python-for-data-engineering-53ap</guid>
      <description>&lt;p&gt;Demand, storage and usage of data is increasingly becoming more of a “must” rather than “if”. It is estimated that “By** 2025*&lt;em&gt;, there will be **175 zettabytes&lt;/em&gt;* of data in the global data-sphere”. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Companies&lt;/strong&gt; are now placing a higher value on data. Companies are discovering new ways to use data to their advantage. Data can and is being used to analyze the current status of their business, forecast the future, model their customers, avoid threats and develop new goods. Data Engineering is the linchpin in all these activities.&lt;/p&gt;

&lt;p&gt;As** Data Engineering &lt;strong&gt;lies at the core of handling and processing data, the second question that begs to be asked is *&lt;em&gt;“What tools/technologies can be leveraged to derive maximum benefit from data with minimum and least complicated effort.” *&lt;/em&gt;&lt;/strong&gt;Python** here presents itself as an ideal candidate, Python is &lt;strong&gt;today’s most popular programming language&lt;/strong&gt; with endless applications in various fields. It is ideally suited for deployment, analysis, and maintenance thanks to its &lt;strong&gt;flexible and dynamic nature.&lt;/strong&gt; Thus here the concept “Python for Data Engineering” is introduced as one of the most crucial skills required in data engineering: to create Data Pipelines, set up Statistical Models, and perform a thorough analysis on them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python for Data Engineering&lt;/strong&gt; mainly comprises &lt;strong&gt;Data Wrangling such as reshaping, aggregating, joining disparate sources, small-scale ETL(Extract, Transform ,Load), API interaction, and automation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For numerous reasons, Python is popular. Its ubiquity is one of the greatest advantages. Python is one of the world’s three leading programming languages. For instance, in November 2020 it ranked second in the TIOBE Community Index and third in the 2020 Developer Survey of Stack Overflow.&lt;br&gt;
Python is a general-purpose, programming language. Because of its ease of use and various libraries for accessing databases(Boto3, Psycopg2, mysql connectors) and storage technologies, it has become a popular tool to execute ETL jobs. Many teams use Python for Data Engineering rather than an ETL tool because it is more versatile and powerful for these activities.&lt;br&gt;
Machine Learning and AI teams also use Python widely. Teams working together closely, typically have to communicate in the same language, while Python is the lingua franca in the field.&lt;br&gt;
Another reason Python is more popular is its use in technologies such as Apache Airflow and libraries for popular tools such as Apache Spark. If you have tools like these in your business, it is important to know the languages you utilize.&lt;br&gt;
Python Developer Community- There exists a very wide and rich python community that offers solutions and support for bugs that you might encounter .&lt;br&gt;
Python for Data Engineering is popular rather than Java. Python has a broad range of characteristics that distinguish it from other languages of programming. Some of those features are given below:&lt;/p&gt;

&lt;p&gt;Ease-of-Use: Both are expressive and we can achieve a high functionality level with them. Python is more user-friendly and concise. Python’s simple, easy-to-learn and read syntax makes it easy to understand and helps you write short-line codes as compared to Java.&lt;br&gt;
Learning Curve: In addition to having support communities, they are both functional and object-oriented languages. Because of its high-level functional characteristics, Java is a bit more complex than Python to master. For simple intuitive logic, Python is preferable, whereas Java is better used in complex workflows. Concise syntax and good standard libraries are provided by Python.&lt;br&gt;
Wide Applications: The biggest benefit of Python over Java is the simplicity of use in Data Science, Big Data, Data Mining, Artificial Intelligence, and Machine Learning&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Top 5 Python Packages used in Data Engineering:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Pandas&lt;/strong&gt;&lt;br&gt;
Pandas is a Python open-source package that offers high-performance, simple-to-use data structures and tools to analyze data. Pandas is the ideal Python for Data Engineering tool to wrangle or manipulate data. It is meant to handle, read, aggregate, and visualize data quickly and easily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. pygrametl&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;pygrametl delivers commonly used programmatic ETL development functionalities and allows the user to rapidly build effective, fully programmable ETL flows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3) petl&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;petl is a Python library for the broad purpose of extracting, manipulating, and loading data tables. It offers a broad range of functions to convert tables with little lines of code, in addition to supporting data imports from CSV, JSON, and SQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4) Beautiful Soup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Beautiful Soup is a prominent online scraping and parsing tool on the data extraction front. It provides Python for Data Engineering tools to parse hierarchical information formats, including on the web, for example, HTML pages or JSON files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5) SciPy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The SciPy module offers a large array of numerical and scientific methods used in Python for Data Engineering that are used by an engineer to carry out computations and solve problems.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Data Engineering</title>
      <dc:creator>VICTOR MAINA</dc:creator>
      <pubDate>Thu, 29 Sep 2022 06:18:46 +0000</pubDate>
      <link>https://dev.to/victormaina001/introduction-to-data-engineering-45gm</link>
      <guid>https://dev.to/victormaina001/introduction-to-data-engineering-45gm</guid>
      <description>&lt;p&gt;what is Data Engineering and what is the role of a data engineer?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mbc2Z_0G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n8rtsji3wa0as219f0wp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mbc2Z_0G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n8rtsji3wa0as219f0wp.jpg" alt="Image description" width="850" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to one of the many definitions you will find there I would like to present to one popular one I like, Data engineering is the practice of designing and building systems for collecting, storing, and analyzing data at scale. The definition of the work data engineers do falls under the lines of :&lt;/p&gt;

&lt;p&gt;i) Data engineers work in a variety of settings to build systems that collect, manage, and convert raw data into usable information for data scientists and business analysts to interpret. Their ultimate goal is to make data accessible so that organizations can use it to evaluate and optimize their performance.&lt;/p&gt;

&lt;p&gt;ii) Data engineers design and build pipelines that transform and transport data into a format wherein, by the time it reaches the Data Scientists or other end users, it is in a highly usable state. These pipelines must take data from many disparate sources and collect them into a single warehouse that represents the data uniformly as a single source of truth.&lt;/p&gt;

&lt;p&gt;Why Data Engineering ?&lt;/p&gt;

&lt;p&gt;Data engineering as a role is a fairly new and emerging position. LinkedIn’s 2020 Emerging Jobs Report and Hired’s 2019 State of Software Engineers Report ranked Data Engineer jobs right up there with Data Scientist and Machine Learning Engineer. However, for some companies, especially those still finding their legs in data science or AI, it’s not always apparent what data engineering is, what role Data Engineers play within the analytics team and what skills are required (and should be vetted) to do the job. Careers in data engineering can or maybe influenced by passion for data, seeking being a problem solver, or even the money factor(as data engineering is a fairly new position it is not yet saturated and demand is still very high.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cRIt_CtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkrnqddwfore9oj6btpn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cRIt_CtK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mkrnqddwfore9oj6btpn.png" alt="Image description" width="880" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Engineering Salary&lt;/strong&gt;&lt;br&gt;
Data engineering is a well-paying career. The average salary in the US is $115,176, with some data engineers earning as much as $168,000 per year, according to Glassdoor (May 2022) [4].&lt;/p&gt;

&lt;p&gt;**Data Engineering Tools:-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FtcDL7VS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpzxdp7n84488t32nwf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FtcDL7VS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpzxdp7n84488t32nwf4.png" alt="Image description" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache Hadoop**: is a foundational data engineering framework for storing and analyzing massive amounts of information in a distributed processing environment. Rather than being a single entity, Hadoop is a collection of open-source tools such as HDFS (Hadoop Distributed File System) and the MapReduce distributed processing engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apache Spark&lt;/strong&gt;: is a Hadoop-compatible data processing platform that, unlike MapReduce, can be used for real-time stream processing as well as batch processing. It is up to 100 times faster than MapReduce and seems to be in the process of displacing it in the Hadoop ecosystem. Spark features APIs for Python, Java, Scala, and R, and can run as a stand-alone platform independent of Hadoop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apache Kafka&lt;/strong&gt;: is today’s most widely used data collection and ingestion tool. Easy to set up and use, Kafka, is a high-performance platform that can stream large amounts of data into a target like Hadoop very quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apache Cassandra&lt;/strong&gt; is widely used to manage large amounts of data with lower latency for users and automatic replication to multiple nodes for fault-tolerance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL and NoSQ&lt;/strong&gt;L (relational and non-relational databases)are foundational tools for data engineering applications. Historically, relational databases such as DB2 or Oracle have been the standard. But with modern applications increasingly handling massive amounts of unstructured, semi-structured, and even polymorphic data in real-time, non-relational databases are now coming into their own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming Languages:-&lt;br&gt;
Python&lt;/strong&gt; is a very popular general-purpose language. Widely used for statistical analysis tasks, it could be called the lingua franca of data science. Fluency in Python (along with SQL) appears as a requirement in over two-thirds of data engineer job listings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ris&lt;/strong&gt; a unique language with features that other programming languages lack. This vector language is finding use cases across multiple data science categories, from financial applications to genetics and medicine.&lt;br&gt;
**&lt;br&gt;
Java,** because of its high execution speeds, is the language of choice for building large-scale data systems. It is the foundation for the data engineering efforts of companies such as Facebook and Twitter. Hadoop is written mostly in Java.&lt;br&gt;
**&lt;br&gt;
Scala** is an extension of Java that is particularly suited for use with Apache Spark. In fact, Spark is written in Scala. Although Scala runs on JVM (Java Virtual Machine), the Scala code is cleaner and more concise than the Java equivalent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Torture the data, and it will confess to anything.” — Ronald Coase&lt;/strong&gt;&lt;br&gt;
**&lt;/p&gt;

&lt;p&gt;Path to become a Data Engineer&lt;br&gt;
**&lt;br&gt;
With the right set of skills and knowledge, you can launch or advance a rewarding career in data engineering.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Develop your data engineering skills.
Learn the fundamentals of cloud computing(could be GCP, AWS, Microsoft Azure), coding skills(most preferred Language being Python because of its robust architecture, readability and a vast community support), and database(Spark (PySPark, Spark SQL,SQL (Relational &amp;amp; NoSQL)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;design as a starting point for a career in data science.&lt;br&gt;
Coding: Proficiency in coding languages is essential to this role, so consider taking courses to learn and practice your skills. Common programming languages include SQL, NoSQL, Python, Java, R, and Scala.&lt;br&gt;
Relational and non-relational databases: Databases rank among the most common solutions for data storage. You should be familiar with both relational and non-relational databases, and how they work.&lt;br&gt;
ETL (extract, transform, and load) systems: ETL is the process by which you’ll move data from databases and other sources into a single repository, like a data warehouse. Common ETL tools include Xplenty, Stitch, Alooma, and Talend.&lt;br&gt;
Data storage: Not all types of data should be stored the same way, especially when it comes to big data. As you design data solutions for a company, you’ll want to know when to use a data lake versus a data warehouse, for example.&lt;br&gt;
Automation and scripting. Automation is a necessary part of working with big data simply because organizations are able to collect so much information. You should be able to write scripts to automate repetitive tasks.&lt;br&gt;
Machine learning: While machine learning is more the concern of data scientists, it can be helpful to have a grasp of the basic concepts to better understand the needs of data scientists on your team.&lt;br&gt;
Big data tools: Data engineers don’t just work with regular data. They’re often tasked with managing big data. Tools and technologies are evolving and vary by company, but some popular ones include Hadoop, MongoDB, and Kafka.&lt;br&gt;
Cloud computing: You’ll need to understand cloud storage and cloud computing as companies increasingly trade physical servers for cloud services. Beginners may consider a course in Amazon Web Services (AWS) or Google Cloud.&lt;br&gt;
Data security: While some companies might have dedicated data security teams, many data engineers are still tasked with securely managing and storing data to protect it from loss or theft.&lt;br&gt;
Read more: 5 Cloud Certifications for Your IT Career&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get certified and learn from communities
A certification can validate your skills to potential employers, and preparing for a certification exam is an excellent way to develop your skills and knowledge. Options include the Associate Big Data Engineer, Cloudera Certified Professional Data Engineer, IBM Certified Data Engineer, or Google Cloud Certified Professional Data Engineer. Learn as community also offers that group kind of support and learning together pushing and encouraging each other(this could be boot camps). Currently here in Kenya Data Science East Africa and Lux Tech Academy are running a boot camp dabbed “Data Engineering Mentorship program by Data Science East Africa”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out some job listings for roles you may want to apply for. If you notice a particular certification is frequently listed as required or recommended, that might be a good place to start.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a portfolio of data engineering projects.
A portfolio is often a key component in a job search, as it shows recruiters, hiring managers, and potential employers what you can do.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can add data engineering projects you’ve completed independently or as part of coursework to a portfolio website (using a service like Wix or Squarespace). Alternately, post your work to the Projects section of your LinkedIn profile or to a site like GitHub — both free alternatives to a standalone portfolio site.&lt;/p&gt;

&lt;p&gt;Brush up on your big data skills with a portfolio-ready Guided Project that you can complete in under two hours. Here are some options to get you started — no software downloads required:&lt;/p&gt;

&lt;p&gt;Create Your First NoSQL Database with MongoDB and Compass&lt;br&gt;
Database Design with SQL Server Management Studio (SSMS)&lt;br&gt;
Database Creation and Modeling using MYSQL Workbench&lt;br&gt;
Read more: How to Build a Data Analyst Portfolio: Tips for Success&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with an entry-level position.
Many data engineers start off in entry-level roles, such as business intelligence analyst or database administrator. As you gain experience, you can pick up new skills and qualify for more advanced roles. See an example of a possible learning journey with this Data Engineering Career Learning Path from Coursera.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do I need a degree to become a data engineer?&lt;/p&gt;

&lt;p&gt;It’s not necessary to have a degree to become a data engineer, though some companies might prefer candidates with at least a bachelor’s degree. If you’re interested in a career in data engineering and plan to pursue a degree, consider majoring in computer science, software engineering, data science, or information systems.&lt;/p&gt;

&lt;p&gt;Next steps&lt;br&gt;
Whether you’re just getting started or looking to pivot to a new career, start building job-ready skills for roles in data engineering. I hope this article gave some perspective and insight to enable you kick start you journey.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Structure and Algorithms 102: Deep Dive into Data Structure and Algorithms</title>
      <dc:creator>VICTOR MAINA</dc:creator>
      <pubDate>Thu, 29 Sep 2022 05:54:16 +0000</pubDate>
      <link>https://dev.to/victormaina001/data-structure-and-algorithms-102-deep-dive-into-data-structure-and-algorithms-5h2j</link>
      <guid>https://dev.to/victormaina001/data-structure-and-algorithms-102-deep-dive-into-data-structure-and-algorithms-5h2j</guid>
      <description>&lt;p&gt;Algorithmic knowledge combined with a good understanding of the implementation of Data Structures is a perfect blend for anyone who aspires to work in the IT sector. In this topic I am going to cover a bit of a deep dive into data structures and algorithms. There are multiple algorithms and the general ones are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Greedy Algorithm&lt;/li&gt;
&lt;li&gt;Dynamic Programming&lt;/li&gt;
&lt;li&gt;Divide &amp;amp; Conquer Algorithm&lt;/li&gt;
&lt;li&gt;Branch and Bound Algorithm&lt;/li&gt;
&lt;li&gt;Backtracking&lt;/li&gt;
&lt;li&gt;Brute-Force Algorithm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9r4rrz1x66n3xgx8i18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9r4rrz1x66n3xgx8i18.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are also other algorithms such as searching algorithms, sorting Algorithms and domain-specific ML Algorithms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Searching Algorithms:&lt;/strong&gt;&lt;br&gt;
Linear Search — O(n)&lt;br&gt;
Binary Search — O(log n)&lt;br&gt;
**&lt;br&gt;
Sorting Algorithms:**&lt;br&gt;
Selection Sort&lt;br&gt;
Insertion Sort&lt;br&gt;
Bubble Sort&lt;br&gt;
Merge Sort&lt;br&gt;
Quick Sort&lt;br&gt;
Heap Sort&lt;br&gt;
Radix Sort&lt;br&gt;
Bucket Sort&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asymptotic Notations&lt;/strong&gt;&lt;br&gt;
Asymptotic notations are the mathematical notations used to describe the running time of an algorithm when the input tends towards a particular value or a limiting value.&lt;/p&gt;

&lt;p&gt;For example: In bubble sort, when the input array is already sorted, the time taken by the algorithm is linear i.e. the best case.&lt;/p&gt;

&lt;p&gt;But, when the input array is in reverse condition, the algorithm takes the maximum time (quadratic) to sort the elements i.e. the worst case.&lt;/p&gt;

&lt;p&gt;When the input array is neither sorted nor in reverse order, then it takes average time. These durations are denoted using asymptotic notations.&lt;/p&gt;

&lt;p&gt;There are mainly **three **asymptotic notations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Big Theta (Θ)&lt;/li&gt;
&lt;li&gt;Big Oh(O)&lt;/li&gt;
&lt;li&gt;Big Omega (Ω)&lt;/li&gt;
&lt;li&gt;Big-O Notation (O-notation)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88bb1rucqobwpkhcmv7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88bb1rucqobwpkhcmv7c.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Big-O notation represents the upper bound of the running time of an algorithm. Thus, it gives the worst-case complexity of an algorithm.&lt;/p&gt;

&lt;p&gt;It tells us that a certain function will never exceed a specified time for any value of input.&lt;/p&gt;

&lt;p&gt;Since it gives the worst-case running time of an algorithm, it is widely used to analyze an algorithm as we are always interested in the worst-case scenario.&lt;/p&gt;

&lt;p&gt;Omega Notation (Ω-notation)&lt;br&gt;
Omega notation represents the lower bound of the running time of an algorithm. Thus, it provides the best case complexity of an algorithm.&lt;/p&gt;

&lt;p&gt;This always indicates the minimum time required for any algorithm for all input values, for the time complexity for any algorithm in the form of big-Ω, we mean that the algorithm will take at least this much time to complete it’s execution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukbvjasy4tkivr6saef0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukbvjasy4tkivr6saef0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Theta Notation (Θ-notation)&lt;br&gt;
Theta notation encloses the function from above and below. Since it represents the upper and the lower bound of the running time of an algorithm, it is used for analyzing the average-case complexity of an algorithm.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kbtx6k0tso8q9apdup3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1kbtx6k0tso8q9apdup3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**Space complexity **is the amount of memory used by the algorithm (including the input values to the algorithm) to execute and produce the result. Sometime Auxiliary Space is confused with Space Complexity. But Auxiliary Space is the extra space or the temporary space used by the algorithm during it’s execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space Complexity = Auxiliary Space + Input space&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Memory Usage while Execution&lt;br&gt;
While executing, algorithm uses memory space for three reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Instruction Space
It’s the amount of memory used to save the compiled version of instructions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.Environmental Stack&lt;/p&gt;

&lt;p&gt;Sometimes an algorithm(function) may be called inside another algorithm(function). In such a situation, the current variables are pushed onto the system stack, where they wait for further execution and then the call to the inside algorithm(function) is made.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Space&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Amount of space used by the variables and constants.&lt;/p&gt;

&lt;p&gt;while calculating the Space Complexity of any algorithm, we usually consider only Data Space and we neglect the Instruction Space and Environmental Stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Calculating the Space Complexity&lt;/strong&gt;&lt;br&gt;
For calculating the space complexity, we need to know the value of memory used by different type of datatype variables, which generally varies for different operating systems, but the method for calculating the space complexity remains the same.&lt;/p&gt;

&lt;p&gt;bool, char, unsigned char, signed char, __int8 –1 byte&lt;/p&gt;

&lt;p&gt;_&lt;em&gt;int16, short, unsigned short, wchar_t, __wchar&lt;/em&gt; t — 2 bytes&lt;/p&gt;

&lt;p&gt;float, __int32, int, unsigned int, long, unsigned long — 4 bytes&lt;/p&gt;

&lt;p&gt;double, __int64, long double, long long — 8 bytes&lt;/p&gt;

&lt;p&gt;example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    int z = a + b + c;
    return(z);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;a, b, c and z are all integer types, hence they will take up 4 bytes each, so total memory requirement will be (4(4) + 4) = 20 bytes, this additional 4 bytes is for return value. And because this space requirement is fixed for the above example, hence it is called Constant Space Complexity.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;int sum(int a[], int n)&lt;br&gt;
{&lt;br&gt;
    int x = 0;// 4 bytes for x&lt;br&gt;
    for(int i = 0; i &amp;lt; n; i++) // 4 bytes for i&lt;br&gt;
    {   &lt;br&gt;
        x  = x + a[i];      &lt;br&gt;
    }&lt;br&gt;
    return(x);&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the above code, 4*n bytes of space is required for the array a[] elements.&lt;br&gt;
4 bytes each for x, n, i and the return value.&lt;br&gt;
Hence the total memory requirement will be (4n + 12), which is increasing linearly with the increase in the input value n, hence it is called as Linear Space Complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time Complexity of Algorithms&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Time complexity of an algorithm represents the amount of time required by the algorithm to run to completion. Time requirements can be defined as a numerical function T(n), where T(n) can be measured as the number of steps, provided each step consumes constant time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;calculating time complexities examples&lt;/strong&gt;&lt;br&gt;
Constant Time — O(1)&lt;br&gt;
An algorithm is said to have a constant time when it is not dependent on the input data (n). No matter the size of the input data, the running time will always be the same. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if a &amp;gt; b:&lt;br&gt;
    return True&lt;br&gt;
else:&lt;br&gt;
    return False&lt;/code&gt;&lt;br&gt;
Now, let’s take a look at the function get_first which returns the first element of a list:&lt;br&gt;
`&lt;br&gt;
def get_first(data):&lt;br&gt;
    return data[0]&lt;/p&gt;

&lt;p&gt;if &lt;strong&gt;name&lt;/strong&gt; == '&lt;strong&gt;main&lt;/strong&gt;':&lt;br&gt;
    data = [1, 2, 9, 8, 3, 4, 7, 6, 5]&lt;br&gt;
    print(get_first(data))`&lt;/p&gt;

&lt;p&gt;Independently of the input data size, it will always have the same running time since it only gets the first value from the list.&lt;/p&gt;

&lt;p&gt;An algorithm with constant time complexity is excellent since we don’t need to worry about the input size.&lt;/p&gt;

&lt;p&gt;Logarithmic Time — O(log n)&lt;br&gt;
An algorithm is said to have a logarithmic time complexity when it reduces the size of the input data in each step (it don’t need to look at all values of the input data), for example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;for index in range(0, len(data), 3):&lt;br&gt;
    print(data[index])&lt;/code&gt;&lt;br&gt;
Algorithms with logarithmic time complexity are commonly found in operations on binary trees or when using binary search . Let’s take a look at the example of a binary search, where we need to find the position of an element in a sorted list:&lt;/p&gt;

&lt;p&gt;`def binary_search(data, value):&lt;br&gt;
    n = len(data)&lt;br&gt;
    left = 0&lt;br&gt;
    right = n - 1&lt;br&gt;
    while left &amp;lt;= right:&lt;br&gt;
        middle = (left + right) // 2&lt;br&gt;
        if value &amp;lt; data[middle]:&lt;br&gt;
            right = middle - 1&lt;br&gt;
        elif value &amp;gt; data[middle]:&lt;br&gt;
            left = middle + 1&lt;br&gt;
        else:&lt;br&gt;
            return middle&lt;br&gt;
    raise ValueError('Value is not in the list')&lt;/p&gt;

&lt;p&gt;if &lt;strong&gt;name&lt;/strong&gt; == '&lt;strong&gt;main&lt;/strong&gt;':&lt;br&gt;
    data = [1, 2, 3, 4, 5, 6, 7, 8, 9]&lt;br&gt;
    print(binary_search(data, 8))`&lt;/p&gt;

&lt;p&gt;Steps of the binary search:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;calculate the middle of the list.&lt;/li&gt;
&lt;li&gt;If the searched value is lower than the value in the middle of the list, set a new right bounder.&lt;/li&gt;
&lt;li&gt;If the searched value is higher than the value in the middle of the list, set a new left bounder.&lt;/li&gt;
&lt;li&gt;If the search value is equal to the value in the middle of the list, return the middle (the index).&lt;/li&gt;
&lt;li&gt;Repeat the steps above until the value is found or the left bounder is equal or higher the right bounder.
It is important to understand that an algorithm that must access all elements of its input data cannot take logarithmic time, as the time taken for reading input of size n is of the order of n.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;other time complexities include:&lt;/p&gt;

&lt;p&gt;Constant Time O(1),Logarithmic Time O(log n) , Linear Time O(n) ,Quasilinear Time O(n log n), Quadratic Time O(n²) Exponential Time O(2^n) Factorial Time O(n!).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms</title>
      <dc:creator>VICTOR MAINA</dc:creator>
      <pubDate>Thu, 29 Sep 2022 05:44:42 +0000</pubDate>
      <link>https://dev.to/victormaina001/introduction-to-data-structures-and-algorithms-4m8b</link>
      <guid>https://dev.to/victormaina001/introduction-to-data-structures-and-algorithms-4m8b</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q34gWD1_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9fd79k9lp28t2swpfhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q34gWD1_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z9fd79k9lp28t2swpfhu.png" alt="Image description" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data structures and algorithms are “components” of software development that enable one to write efficient( minimum memory and storage needs) software.&lt;/p&gt;

&lt;p&gt;Data Structures — These can be looked as like the ingredients you need to build efficient algorithms. These are the ways to arrange data so that they (data items) can be used efficiently in the main memory. Examples: Array, Stack, Linked List.&lt;/p&gt;

&lt;p&gt;Algorithms — These are a sequence of steps performed on data using efficient data structures to solve a given problem, be it a basic or real-life-based one. Examples include: sorting an array or adding two numbers and displaying the result. Simply put as the path between a problem and a solution.&lt;/p&gt;

&lt;p&gt;characteristics that make up a good algorithm.&lt;/p&gt;

&lt;p&gt;These include:&lt;/p&gt;

&lt;p&gt;1.Input specified&lt;br&gt;
2.Output specified&lt;br&gt;
3.Definiteness&lt;br&gt;
4.Effectiveness&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Finiteness
6.Independent
In recent years in software development, skills tests on data structures and algorithms have become more and more crucial; This does indicate and stress on the importance of learning and developing this skill and on the attainment of this skill in your arsenal puts you ahead of the crowd.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Algorithm example for adding two numbers:&lt;/p&gt;

&lt;p&gt;1.start&lt;/p&gt;

&lt;p&gt;2.prompt for first number as input(num1)&lt;/p&gt;

&lt;p&gt;2.prompt for second number as input(num2)&lt;/p&gt;

&lt;p&gt;3.Assign user input to num1 and num2 (num1 ← first number, num2 ← second number).&lt;/p&gt;

&lt;p&gt;4.Add num1 and num2 (num1 + num2).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Assign the result to sum. (sum ← num1 + num2)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;6.Print sum&lt;/p&gt;

&lt;p&gt;7.Stop&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Data Structures:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Primitive data structures&lt;/li&gt;
&lt;li&gt;Non-primitive data structures&lt;/li&gt;
&lt;li&gt;Primitive Data structures&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The primitive data structures are essentially the bare data types. These are int, char, float, double, and pointer which can only hold a single value.&lt;/p&gt;

&lt;p&gt;Non-Primitive Data structures&lt;/p&gt;

&lt;p&gt;The non-primitive data structure is divided into two types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Linear data structure&lt;/li&gt;
&lt;li&gt;Non-linear data structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Linear Data Structures&lt;/strong&gt;&lt;br&gt;
The arrangement of data is in a sequential manner hence the name “linear data structure” , examples include Arrays, Linked list, Stacks, and Queues. In these data structures, one element is connected to only one another element in a linear form.&lt;/p&gt;

&lt;p&gt;Non- linear Data structures are ideally the opposite of the linear Data structures, the elements are not limited to connections of only one other element in a linear form such as map, graph and tree.&lt;/p&gt;

&lt;p&gt;Static and Dynamic Data Structures&lt;/p&gt;

&lt;p&gt;Static data structures are fixed in size, while dynamic ones can increase or decrease in size. The size is usually in terms of space the data structure occupies. Therefore the size of a static data structure cannot be changed only its content.&lt;/p&gt;

&lt;p&gt;Dynamic data structures are flexible, allowing you to change the size of the element and the contents in runtime. Each of the two has a different use case depending on what you want to do in your program.&lt;/p&gt;

&lt;p&gt;This is a little bit of an introduction to Data Structures and Algorithms, I hope you had an amazing read.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
