<?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: ahseya03</title>
    <description>The latest articles on DEV Community by ahseya03 (@ahseya03).</description>
    <link>https://dev.to/ahseya03</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%2F982795%2Fb8ecd645-6704-43cc-996e-1c251f4737b3.jpeg</url>
      <title>DEV Community: ahseya03</title>
      <link>https://dev.to/ahseya03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahseya03"/>
    <language>en</language>
    <item>
      <title>🎨 Primitive Data Types are like Primary Colors for creating Non-Primitive Data Types 🎨</title>
      <dc:creator>ahseya03</dc:creator>
      <pubDate>Wed, 21 Dec 2022 00:02:56 +0000</pubDate>
      <link>https://dev.to/ahseya03/primitive-data-types-are-primary-colors-for-creating-non-primitive-data-types-4d01</link>
      <guid>https://dev.to/ahseya03/primitive-data-types-are-primary-colors-for-creating-non-primitive-data-types-4d01</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;"When you mix any of the primary colors: red, yellow, blue. it results in a secondary color. Similarly, when you mix Primitive Data type, it results in a Non-Primitive Data type."- Ayesha Mahmood&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
An example of a &lt;strong&gt;primitive data type&lt;/strong&gt; is  "char". &lt;strong&gt;A char is a C++ data type used for the storage of a single letter&lt;/strong&gt;. For eg. we have the char "H" as the primitive data type. So when we mix and combine the primary primitive data type i.e. &lt;strong&gt;char "H"&lt;/strong&gt; with other letters like &lt;strong&gt;"e", "l", "l, "o"&lt;/strong&gt;. &lt;strong&gt;It results in a string "hello" which is a Non-Primitive data type&lt;/strong&gt;. &lt;strong&gt;Hence we see that we can similarly in this manner mix other primitive data types to create secondary Non- Primitive Data Types&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BdIGowXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmseagbu4v1n2f7d3ea8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BdIGowXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mmseagbu4v1n2f7d3ea8.png" alt="Image description" width="880" height="599"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Previous Post:&lt;/strong&gt; Importance of Data Structure in Computer Science&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/ahseya03" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zgLNUreK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--SVXRXJtL--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/982795/b8ecd645-6704-43cc-996e-1c251f4737b3.jpeg" alt="ahseya03"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/ahseya03/data-structure-why-it-is-so-important-348i" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Data Structure &amp;amp; Why It Is So Important? 👩‍💻👨‍💻&lt;/h2&gt;
      &lt;h3&gt;ahseya03 ・ Dec 16 ・ 2 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#computerscience&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>cpp</category>
      <category>computerscience</category>
      <category>datascience</category>
    </item>
    <item>
      <title>🌲 🌳 Binary Search Tree 🌲🌳</title>
      <dc:creator>ahseya03</dc:creator>
      <pubDate>Fri, 16 Dec 2022 15:47:49 +0000</pubDate>
      <link>https://dev.to/ahseya03/binary-search-tree-15l4</link>
      <guid>https://dev.to/ahseya03/binary-search-tree-15l4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why do we need Binary Search trees?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary Search Trees are effective solutions to any real word problems and they are optimum solutions due to speed and accuracy.&lt;/li&gt;
&lt;li&gt;Binary Search Tree is O (log n) average case.&lt;/li&gt;
&lt;li&gt;Binary Search Tree is like a branch-like format, the algorithm knows where to search for the elements.&lt;/li&gt;
&lt;li&gt;There are fewer comparisons done to find key-value pairs.&lt;/li&gt;
&lt;li&gt;It is O (log n).&lt;/li&gt;
&lt;li&gt;It supports operations like search inserts and deletes.
For example, if you are trying to design an account class you may have the account number for the clients stored in a Binary Search Tree, and through this system it can support operations like inserting that is opening an account, searching for an account, or deleting an account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Properties of Binary Search Tree:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;There is the main node or top-level node: It has a left and right subtree.&lt;/li&gt;
&lt;li&gt;Left value Subtree has values less than node.&lt;/li&gt;
&lt;li&gt;Right Side Subtree has values greater than the node.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Binary Search Tree Searching: (PseudoCode)&lt;/strong&gt;&lt;br&gt;
1- Check if the Binary Search Tree is empty, if yes print a not found message, meaning it is not there.&lt;br&gt;
2- If it is not empty, compare the key with the given value.&lt;br&gt;
3- If root equals given value, then print key found.&lt;br&gt;
4- It is not equal to the given value check where to search &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if given value &amp;lt; root key search left subtree, then start from step 1 again till you find it.

&lt;ul&gt;
&lt;li&gt;If the given value is &amp;gt; root key, search the right subtree then start from step 1 again till you find it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;Binary Search Insertion *&lt;/em&gt;&lt;br&gt;
1- Check if the Binary Search Tree is empty if yes insert the node.&lt;br&gt;
2- If it is not empty compare the root with the given value&lt;br&gt;
3- If root key &amp;lt; given value go to the right subtree to find a position to insert the new node.&lt;br&gt;
4- If root key &amp;gt; given value go to the left subtree to find a position to insert the new node.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/F8WLu--EhYU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binary Search Removal:&lt;/strong&gt;&lt;br&gt;
There are &lt;strong&gt;3 cases&lt;/strong&gt; to remove:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Empty Tree:&lt;/strong&gt;&lt;br&gt;
You can't do anything since there is nothing to remove.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Do Nothing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Root Node&lt;/strong&gt;&lt;br&gt;
Find the Smallest item on left and delete the root node and replace it with the smallest item on left&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             10                              11
           /     \         delete(10)      /     \
          7       15       ---------&amp;gt;    7        15 
         /  \    /  \                   /  \        \ 
        5    8  11   18                5    8        18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- All Other Case is divided into 3 types:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deleting Leaf Node that has no children :
Simply delete the leaf node without any issues.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
             10                             10
           /     \         delete(5)      /     \
          7       15       ---------&amp;gt;    7       15 
         /  \    /  \                     \     /  \ 
        5    8  11   18                    8   11   18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deleting Node that has one child:
Delete the node and replace deleted node with its child.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             10                              10
           /     \         delete(15)      /     \
          7       15       ---------&amp;gt;    7       11 
         /  \    /                      /  \      
        5    8  11                     5    8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deleting Node that has 2 children
Either go to the right tree and find the smallest value/ go to the left tree and find the biggest value to push it up in the node.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             10                             10
           /     \         delete(15)      /     \
          7       15       ---------&amp;gt;    7       11 
         /  \    /  \                   / \        \ 
        5    8  11   18                5   8      18
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NWivqiqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbf9e72df2apljh4os7f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NWivqiqg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbf9e72df2apljh4os7f.png" alt="Image description" width="880" height="759"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Pre Order Traversal&lt;/strong&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/U99TAMyQU-E"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In Order Traversal&lt;/strong&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hIgwX6OG5P0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Post Order Traversal&lt;/strong&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rA_f8GenBtw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Data Structure &amp; Why It Is So Important? 👩‍💻👨‍💻</title>
      <dc:creator>ahseya03</dc:creator>
      <pubDate>Fri, 16 Dec 2022 06:03:54 +0000</pubDate>
      <link>https://dev.to/ahseya03/data-structure-why-it-is-so-important-348i</link>
      <guid>https://dev.to/ahseya03/data-structure-why-it-is-so-important-348i</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;"To build a house, you need a structure. When you choose the right structure for your house, your design aligns perfectly. Similarly, Data structures are programming structures essential in building your best program." - Ayesha Mahmood&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Data Structures are classified into two types:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Primitive Data Types&lt;/li&gt;
&lt;li&gt;Non-Primitive Data Types&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Learn More about Primitive &amp;amp; Non Primitive Data types **&lt;br&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/ahseya03" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zgLNUreK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--SVXRXJtL--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/982795/b8ecd645-6704-43cc-996e-1c251f4737b3.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zgLNUreK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--SVXRXJtL--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/982795/b8ecd645-6704-43cc-996e-1c251f4737b3.jpeg" alt="ahseya03"&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/ahseya03/primitive-data-types-are-primary-colors-for-creating-non-primitive-data-types-4346-temp-slug-6931250" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Primitive Data Types are Primary Colors for creating Non Primitive Data Types&lt;/h2&gt;
      &lt;h3&gt;ahseya03 ・  ・ 1 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;
&lt;br&gt;
 **Overview of Data Structure Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choose your Structure!&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Why do we learn about Data Structure in Computer Science?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's hard to understand how Data Structure plays a role in programming and confuses many students why they have to learn Data Structure in their first Computer Science class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data structures&lt;/strong&gt; are actually an essential way one can store data in a particular way that makes it efficient for use.&lt;/p&gt;

&lt;p&gt;When you are writing code there will be data you want to store and there will also be data from the user.&lt;/p&gt;

&lt;p&gt;We need something to store that data. &lt;strong&gt;So how do we store that data?&lt;/strong&gt; This is where data structure comes in handy and that is the function of data structure which is built for organizing, processing, retrieving, and storing data.&lt;/p&gt;

&lt;p&gt;Here we defined type as  "string name". We are essentially creating a container of string data type to store only strings. There will be data from the user's side. In this example, the user will enter their name(data) as a "string" data type and this name will be stored in the container for string we defined.&lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8x-oiuKR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53llpoao4nrzju5oy9vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8x-oiuKR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53llpoao4nrzju5oy9vc.png" alt="Image description" width="880" height="579"&gt;&lt;/a&gt;&lt;br&gt;
We are asking the user for input. We are asking the user to type or input their name by using "cin name" command. We are getting input from the user. When asked for a name, the user entered "Sarah". "Sarah" string data is entered by the user which is then stored in the string container. The data is then  processed and retrieved back to the console as output "Hello Sarah."&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
