<?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: Alvinimbua</title>
    <description>The latest articles on DEV Community by Alvinimbua (@alvinimbua).</description>
    <link>https://dev.to/alvinimbua</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%2F572021%2F3921f94a-acd5-460d-ad95-612099369f73.png</url>
      <title>DEV Community: Alvinimbua</title>
      <link>https://dev.to/alvinimbua</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alvinimbua"/>
    <language>en</language>
    <item>
      <title>Deep dive into Data Structures &amp; Algorithms.</title>
      <dc:creator>Alvinimbua</dc:creator>
      <pubDate>Tue, 28 Jun 2022 09:52:21 +0000</pubDate>
      <link>https://dev.to/alvinimbua/deep-dive-into-data-structures-algorithms-4nae</link>
      <guid>https://dev.to/alvinimbua/deep-dive-into-data-structures-algorithms-4nae</guid>
      <description>&lt;p&gt;In this article, we will discuss about the data structures and algorithms in the Python programming language. The common data structures in python include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lists&lt;/li&gt;
&lt;li&gt;Sets&lt;/li&gt;
&lt;li&gt;Tuples&lt;/li&gt;
&lt;li&gt;Dictionaries&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lists
&lt;/h2&gt;

&lt;p&gt;A list is used to store one or more python objects or data types. Lists are commonly enclosed within square brackets([]) and elements are comma separated. List has some methods which include list.append(x),list.insert(i,x),list.remove(x), list.count(x), list.index(x) just but to mention a few.&lt;br&gt;
Below is an example of list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; months = ['January', 'February', 'July', 'June']
&amp;gt;&amp;gt;&amp;gt; months.count('July')
3
&amp;gt;&amp;gt;&amp;gt;months.index('February')
1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also one thing to note is that Lists are mutable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sets
&lt;/h2&gt;

&lt;p&gt;It is a type of data structure that contains a collection of unique elements. It uses hash to improve performance. Indexing is not supported in this of data structure. It is also mutable, meaning it can be changed once declared. Are denoted by the use of curly brackets({}). N/B To create an empty set you have to use set() and not {}, since the latter will create a dictionary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; days = {'monday', 'tuesday', 'wedenesday', 'thursday', 'monday'}
&amp;gt;&amp;gt;&amp;gt; print (days)
{'monday', 'tuesday', 'wedenesday', 'thursday'} # duplicates have been removed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Tuples
&lt;/h2&gt;

&lt;p&gt;A tuple built in data structure that contains ordered collection of objects.They come with a limited functionality than lists.&lt;br&gt;
The distinguishing part between tuple and list the mutability aspect in that, tuple are immutable i.e they can not be changed once declared, while list are mutable. They are denoted using parenthesis(), and are separated by comma.&lt;br&gt;
AN example of a tuple is :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tuple = (item 1, item2, item3).&lt;/code&gt;&lt;br&gt;
_&lt;br&gt;
Application of tuple._&lt;br&gt;
-Tuples are used the user does not want to modify data.&lt;br&gt;
-When you want use less memory and execute program faster.&lt;/p&gt;
&lt;h2&gt;
  
  
  Dictionaries
&lt;/h2&gt;

&lt;p&gt;Also a built in data structure, sometimes referred to other languages as associative arrays or associative memories. Dictionaries are indexed by keys, which can be any immutable type; strings and numbers can always be keys.&lt;br&gt;
They are always denoted as key:pair value. Dictionaries are mutable, in that you can insert or delete entries in them. While deleting an item in the dictionary, you use the "del" keyword.&lt;br&gt;
Illustration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; tel = {'alvin': 4098, 'stela': 4139}
&amp;gt;&amp;gt;&amp;gt; tel['moreen'] = 4127
&amp;gt;&amp;gt;&amp;gt; tel
{'alvin': 4098, 'stela': 4139, 'moreen': 4127}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To learn more about data structures in python, kindly refer here &lt;a href="https://docs.python.org/3/tutorial/datastructures.html"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>leetcode</category>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms with Modern JavaScript</title>
      <dc:creator>Alvinimbua</dc:creator>
      <pubDate>Mon, 21 Feb 2022 20:18:55 +0000</pubDate>
      <link>https://dev.to/alvinimbua/introduction-to-data-structures-and-algorithms-with-modern-javascript-5313</link>
      <guid>https://dev.to/alvinimbua/introduction-to-data-structures-and-algorithms-with-modern-javascript-5313</guid>
      <description>&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;In JavaScript, an array is a variable that  stores several elements.Arrays are used when we want store a list of elements and retrieve them with single variable.&lt;br&gt;
In modern JS, an array may hold different data types such as strings, numbers, boolean. All this can be stored in one array. Elements in arrays are denoted by index and therefore the first element of an array is always denoted with the [0] index.&lt;br&gt;
Below is an illustration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arr = ["lux","Alvin", "academy"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence the element lux is in index 0, element Alvin is in index 1 and the element academy is index 2. &lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;It is one of the important data structures and a useful one, with a wide range of applications. It is a linear data structure  where by any addition or deletion of an element follows a particular order i.e Last in Fast Out  (LIFO) and Fast in Last Out (FIFO).&lt;/p&gt;

&lt;p&gt;An example of its implementation is as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Adding element to the stack
stack.push(10);
stack.push(20);
stack.push(30);

// Printing the stack element
// prints [10, 20, 30]
console.log(stack.printStack());

// returns 30
console.log(stack.peek());

// returns 30 and remove it from stack
console.log(stack.pop());

//returns [10, 20]
console.log(stack.printStack());

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information on stack, check out this link.[&lt;a href="https://www.geeksforgeeks.org/implementation-stack-javascript/"&gt;https://www.geeksforgeeks.org/implementation-stack-javascript/&lt;/a&gt;]&lt;/p&gt;

&lt;h2&gt;
  
  
  Queue
&lt;/h2&gt;

&lt;p&gt;Unlike stack, Queue works on the First in First Out (FIFO) principle. Queue performs two basic operations i.e additional of elements at the end of the queue and removal of elements at the front of the queue. It is also a linear data structure. Queue contains functions such as enqueue, dequeue, front(), and is Empty().&lt;br&gt;
An illustration of how the enqueue  and dequeue function is as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// enqueue function
enqueue(element)
{   
    // adding element to the queue
    this.items.push(element);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;//dequeue&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// dequeue function
dequeue()
{
    // removing element from the queue
    // returns underflow when called
    // on empty queue
    if(this.isEmpty())
        return "Underflow";
    return this.items.shift();
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For moreinformation on how Queue works visit [&lt;a href="https://www.geeksforgeeks.org/implementation-queue-javascript/"&gt;https://www.geeksforgeeks.org/implementation-queue-javascript/&lt;/a&gt;].&lt;/p&gt;

&lt;h2&gt;
  
  
  Linked list
&lt;/h2&gt;

&lt;p&gt;Similar to arrays, stack and queue, the linked list data structure is also a linear data structure. Here elements are not stored in a particular memory. They are stored in a separate object that contains a pointer to the next object in that list.&lt;br&gt;
It always has an entry point called the head and which is a reference to the first node in the linked list. The last node on the list points to null.&lt;br&gt;
Null reference means that the list is empty.&lt;/p&gt;

&lt;p&gt;An illustration of how Linked list is as below :&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;const list = {&lt;br&gt;
    head: {&lt;br&gt;
        value: 6&lt;br&gt;
        next: {&lt;br&gt;
            value: 10                                             &lt;br&gt;
            next: {&lt;br&gt;
                value: 12&lt;br&gt;
                next: {&lt;br&gt;
                    value: 3&lt;br&gt;
                    next: null  &lt;br&gt;
                    }&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
};&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;br&gt;
To read more on types of linked lists, checkout this link [&lt;a href="https://www.freecodecamp.org/news/implementing-a-linked-list-in-javascript/"&gt;https://www.freecodecamp.org/news/implementing-a-linked-list-in-javascript/&lt;/a&gt;].&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>100daysofcode</category>
      <category>luxacademy</category>
    </item>
    <item>
      <title>Introduction to Modern JavaScript</title>
      <dc:creator>Alvinimbua</dc:creator>
      <pubDate>Mon, 14 Feb 2022 14:42:10 +0000</pubDate>
      <link>https://dev.to/alvinimbua/introduction-to-modern-javascript-5am4</link>
      <guid>https://dev.to/alvinimbua/introduction-to-modern-javascript-5am4</guid>
      <description>&lt;p&gt;JavaScript(JS) is an interpreted compiled language with first class functions and it is a scripting language. It is an object oriented language. It is very different from java language in terms of the syntax, and its uses. JavaScript allows one to write code that runs inside the web browser on the client side. It makes the web pages to be more interactive. JavaScript give the ability to directly manipulate the DOM (Document Object Model) which is a tree like hierarchy that represents the web page the user happens to be looking at.&lt;/p&gt;

&lt;p&gt;To add Java script into a web page, you only have to include the script tags as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;

&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using this script tags, we are literally telling the browser , that anything between the script tags should be interpreted as JavaScript code that the web browser is going to execute.&lt;br&gt;
An example of how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
alert('Hello, Lux Academy!');
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the above example the, alert word is a function and inside the function, there is an argument which is passed and n this case it is the "Hello, Lux Academy". It is important to note that one can use either double quotes or single quotes to denote the use of strings in JavaScript.&lt;/p&gt;

&lt;p&gt;JavaScript has a various features such as Events, Arrow Functions,Query Selector, JavaScript console, DOM and TODO list, just but to mention a few. JavaScript as one of the feature is explained more below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript Console.&lt;/strong&gt;&lt;br&gt;
It is a useful tool for testing out small chunks of code and debugging. One can write and run JavaScript code in the console and can be found by inspecting your web browser and then clicking console. To use it,one just has to write the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;console.log(arguments are passed here);&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There is much more on JavaScript and to learn more on JavaScript one can visit the Mozilla web docs (MDN Web Docs).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>luxacademy</category>
    </item>
  </channel>
</rss>
