<?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: Ehab Hussein</title>
    <description>The latest articles on DEV Community by Ehab Hussein (@ehabsmh).</description>
    <link>https://dev.to/ehabsmh</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%2F1379995%2Ffcd0b9bd-5eb0-4d91-a1da-6e98ae66300e.png</url>
      <title>DEV Community: Ehab Hussein</title>
      <link>https://dev.to/ehabsmh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ehabsmh"/>
    <language>en</language>
    <item>
      <title>OOP (Object-Oriented Programming) in JavaScript</title>
      <dc:creator>Ehab Hussein</dc:creator>
      <pubDate>Mon, 01 Apr 2024 14:06:03 +0000</pubDate>
      <link>https://dev.to/ehabsmh/oop-14o8</link>
      <guid>https://dev.to/ehabsmh/oop-14o8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Object-Oriented Programming in JavaScript
&lt;/h2&gt;

&lt;p&gt;Object-Oriented Programming (OOP) is a popular programming paradigm that helps organize and structure code by treating objects as the fundamental building blocks of a program. It provides a way to model real-world entities and their relationships, making code more modular, reusable, and easier to maintain. In this blog post, we will explore the basics of OOP in JavaScript, including prototype definition, prototypal inheritance, and the prototype chain.&lt;/p&gt;

&lt;p&gt;In a normal object literal you would define keys and values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  id: "1",
  name: "John",
  age: 30,

  sayHello() {
    console.log(`Hello ${this.name}`);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;without OOP you will repeat the same code over and over each time you want to define another person.&lt;/p&gt;

&lt;p&gt;in OOP we can define the person as a model just once and then instantiate real objects from this model.&lt;br&gt;
Ex: (&lt;strong&gt;This is not a valid code. just for demonstration&lt;/strong&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Person model
const Person = {
  id
  name
  age

  sayHello() {
    console.log(`Hello ${this.name}`);
  }
}

const john = new Person('1', 'John', 30);
const doe = new Person('2', 'Doe', 45);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create a model in javascript there are actually three different ways.&lt;/p&gt;

&lt;p&gt;But we will take here the right one that allows you to understand it easily.&lt;/p&gt;

&lt;p&gt;With constructor functions, you can create a model or a blueprint.&lt;br&gt;
A constructor function is a special type of regular functions, it is used with the new keyword to create instances of a model. This is what makes a function to be a &lt;strong&gt;constructor function&lt;/strong&gt; that constructs a model.&lt;/p&gt;

&lt;p&gt;Great, let's define a constructor function to build our model from the previous example (Person):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Person = function(id, name, age) {
  this.id = id;
  this.name = name;
  this.age = age;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since it is a regular function like any other function, we can leverage the function's arguments to assign values to the properties of each Person instance.&lt;br&gt;
Here we have assigned each argument to its corresponding property.&lt;/p&gt;

&lt;p&gt;This is great, but how can we create instances of this model?&lt;/p&gt;

&lt;p&gt;Here the &lt;strong&gt;new&lt;/strong&gt; keyword comes into play:&lt;/p&gt;

&lt;p&gt;To create an object, we have to call the function with the 'new' keyword:&lt;br&gt;
&lt;code&gt;const john = new Person('1', 'John', 30)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Actually, when we call a function with the 'new' keyword there are 4 things happened:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A new object is created.&lt;/li&gt;
&lt;li&gt;The function is called and 'this' will point to the newly created object.&lt;/li&gt;
&lt;li&gt;The prototype object of the constructor function will be linked to the object. (later)&lt;/li&gt;
&lt;li&gt;The function automatically returns the object.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;console.log(john); // Person { id: '1', name: 'John', age: 30 }&lt;/code&gt;&lt;br&gt;
Now, john's object is created and we can access its property like any other object:&lt;br&gt;
&lt;code&gt;console.log(john.name); // John&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, let's talk about the third feature that 'new' keyword gave to us.&lt;/p&gt;

&lt;p&gt;Every JavaScript object has a prototype, which serves as a blueprint for that object.&lt;br&gt;
For our example, the prototype of john is Person.&lt;/p&gt;

&lt;p&gt;What does it useful for?&lt;br&gt;
Well, we can take advantage of this behavior by defining our methods in the prototype of john which is &lt;strong&gt;Person.prototype&lt;/strong&gt; &lt;br&gt;
and use it whenever an object needs to use it.&lt;br&gt;
So the function in the prototype defined once. this approach is increasing the performance of our web app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Person = function(id, name, age) {
    this.id = id;
    this.name = name;
    this.age = age;
};

Person.prototype.sayHello = function() {
  return `Hello ${this.name}`;
};

const john = new Person('1', 'John', 30);
console.log(john.sayHello()) // Hello John;
console.log(john.__proto__); // prints the prototype of John: Person { sayHello: [Function] }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can access this method by any object of type Person. this approach is called &lt;strong&gt;prototypal inheritance&lt;/strong&gt;, in which the objects is inheriting the methods from its prototype.&lt;/p&gt;

&lt;p&gt;But never define a function inside the constructor function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Person = function(id, name, age) {
    this.id = id;
    this.name = name;
    this.age = age;
    this.sayHello = function() {
    return `Hello ${this.name}`;
    }
};

const john = new Person('1', 'John', 30);
console.log(john.sayHello()) // Hello John;
console.log(john.__proto__); // {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this approach, we are copying the function to each object created. Imagine we've created 1000 objects of type Person, this will define sayHello function for each object, which of course damaging our performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prototype Chain&lt;/strong&gt;&lt;br&gt;
JavaScript uses a prototype chain to find properties and methods of an object. If a property or method is not found on an object, JavaScript looks up the prototype chain until it finds it.&lt;/p&gt;

&lt;p&gt;For example, when we call john.sayHello(), JavaScript first checks if john has a sayHello method. If not, it looks for it in the Person prototype.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Understanding OOP and the prototype chain is essential for writing clean and efficient JavaScript code. By leveraging constructor functions and prototypes, we can create modular and reusable code that is easier to maintain.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>oop</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Versatile 'this' keyword</title>
      <dc:creator>Ehab Hussein</dc:creator>
      <pubDate>Thu, 28 Mar 2024 20:36:00 +0000</pubDate>
      <link>https://dev.to/ehabsmh/the-versatile-this-keyword-mpo</link>
      <guid>https://dev.to/ehabsmh/the-versatile-this-keyword-mpo</guid>
      <description>&lt;p&gt;Many developers find the 'this' keyword confusing, but with a bit of practice, you can grasp its concept easily.&lt;/p&gt;

&lt;p&gt;The 'this' keyword is specially made to point to objects, the value of the 'this' keyword is determined by how a function is called. as example if a function is called in the global context or the global scope it will point to the window object, if it is called inside an object (object's context) as a method it will point to that object.&lt;/p&gt;

&lt;p&gt;To understand this, let's start with its behavior in the global scope:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;console.log(this); // Prints the global object (window in browsers)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the global scope, the value of the 'this' will be the global object, which makes sense because it's the surrounding context.&lt;/p&gt;

&lt;p&gt;Now, let's consider an example where we define a global-scoped function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sayHello = function(name) {
  console.log(this);
};

sayHello('John'); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Since the function is called in the global scope it will point to the window object.&lt;/p&gt;

&lt;p&gt;Let's attach the same function to an object, so instead of calling it globally, let's call it with our object and see how the 'this' keyword will behave:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  firstName: "John",
  lastName: "Doe",
  sayHello: sayHello
};

console.log("----Function called with object----");
person.sayHello('Ehab');
console.log("----Function called globally----");
sayHello();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;As we said, the 'this' keyword for function 'sayHello' will look for its context. is the function called inside a context like the object literal or it is called in the global scope? and then 'this' will be assigned to the object of a context.&lt;/p&gt;

&lt;p&gt;But not with arrow functions, since arrow functions do not have the 'this' keyword, they inherit it from the parent scope.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
  firstName: "John",
  lastName: "Doe",
  fullName: () =&amp;gt; {
    console.log(this); // Prints the window object
    return `${this.firstName} ${this.lastName}`;
  }
};

console.log(person.fullName()); // Prints "undefined undefined"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the previous example, it prints the window object because the arrow function inherited the 'this' keyword from its parent scope which is the global scope. so if you need to use the 'this' keyword do not define arrow functions, just use regular functions&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>DOM (part 1)</title>
      <dc:creator>Ehab Hussein</dc:creator>
      <pubDate>Thu, 28 Mar 2024 02:18:36 +0000</pubDate>
      <link>https://dev.to/ehabsmh/dom-part-1-34lm</link>
      <guid>https://dev.to/ehabsmh/dom-part-1-34lm</guid>
      <description>&lt;p&gt;DOM stands for Document Object Model, which is a web API provided by the web browser for the JavaScript engine in order to style and access the HTML elements from Javascript code&lt;br&gt;
as a conceptual model, it is represented as a tree structure due to its hierarchical nature.&lt;/p&gt;

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

&lt;p&gt;The browser converts this to the below tree structure:&lt;/p&gt;

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

&lt;p&gt;as you can see the document object is leading the tree, actually it isn't the root of the tree but all tree nodes inherit the base functionalities from it. such as &lt;code&gt;addEventListener&lt;/code&gt; which is an inherited function for every HTML element in our tree that allows you to add event to occur on any HTML element you want.&lt;br&gt;
ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.body.addEventListener('click', function() {
        // Change the body's background color to yellow
        this.style.backgroundColor = 'yellow';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the real root here is the HTML object since it is the root element of any HTML file. all children branches branch from it forming the tree structure so it can accessed and manipulated easily&lt;/p&gt;

&lt;p&gt;as example if you want to access the root element which is HTML tag&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.documentElement&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;access body element:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.body&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing Body Elements:&lt;/strong&gt;&lt;br&gt;
To access elements within the &amp;lt;body&amp;gt; of an HTML document, the document object provides various methods and properties. One commonly used method is &lt;strong&gt;getElementById()&lt;/strong&gt;, which allows you to retrieve an element by its unique ID attribute. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;var myElement = document.getElementById('myElementId');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This retrieves the element with the ID &lt;strong&gt;"myElementId"&lt;/strong&gt; from the document's DOM tree.&lt;/p&gt;

&lt;p&gt;Additionally, you can use methods like &lt;strong&gt;getElementsByClassName()&lt;/strong&gt;, &lt;strong&gt;getElementsByTagName()&lt;/strong&gt;, and &lt;strong&gt;querySelector()&lt;/strong&gt; to access elements based on their class names, tag names, or CSS selectors, respectively.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
      <category>browsers</category>
      <category>api</category>
    </item>
    <item>
      <title>var - let - const</title>
      <dc:creator>Ehab Hussein</dc:creator>
      <pubDate>Wed, 27 Mar 2024 21:48:08 +0000</pubDate>
      <link>https://dev.to/ehabsmh/var-let-const-2jk7</link>
      <guid>https://dev.to/ehabsmh/var-let-const-2jk7</guid>
      <description>&lt;p&gt;In the early years of JavaScript, they introduced the only variable declaration keyword "&lt;strong&gt;var&lt;/strong&gt;" that can make you declare a variable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1- var&lt;/strong&gt;&lt;br&gt;
   var is global-scoped or function-scoped, &lt;em&gt;but what does that mean?&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;global scope means that the variable is available to be used at any level in the code after the line where it is declared.
Ex:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var height = 20;
  console.log(height); // output: 20;

  if (true) {
    var width = 20;
  }
  console.log(width); // output: 20;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;function-scoped because when we declare a variable inside a function we can't access it out of that function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function testVar() {
    var test = "Tested";
  }

console.log(test); // ReferenceError: test is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Can be reassigned.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var height = 20;
  height = 0;
  console.log(height) // output: 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Can be redeclared.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  var height = 20;
  var height = 10;
  console.log(height) // output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is important to note that developers abandoned using var keyword due to its global scope and re-declaration behavior since it can be prone to errors. imagine you are writing 200 lines of code and at line 201 you decide to declare a variable that you have already declared but you forgot that you have this variable already initialized above, you need some error message to tell you that you already have this variable initialized. and also to reduce errors you shouldn't access a variable out of its scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2- let&lt;/strong&gt;&lt;br&gt;
Let is block-scoped, that means it will be available to use only at its scope but not in any outer scopes.&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  let height = 20;
  console.log(height); // output: 20;

  if (true) {
    let width = 20;
  }
  console.log(width); // ReferenceError: width is not defined

  function testVar() {
    let test = "Tested";
  }

  console.log(test); // ReferenceError: test is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Can be reassigned, but can't be redeclared.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  let height = 20;
  height = 0;
  console.log(height) // output: 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3- const&lt;/strong&gt;&lt;br&gt;
same as let keyword it is block-scoped but can't be reassigned or redeclared, as the name suggests it is constant and can't be changed.&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  let height = 20;
  console.log(height);
  // output: 20;

  if (true) {
    let width = 20;
  }
  console.log(width);
  ReferenceError: width is not defined

  function testVar() {
    let test = "Tested";
  }

  console.log(test);
  ReferenceError: test is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 1 of #100DaysOfCode Hash Tables</title>
      <dc:creator>Ehab Hussein</dc:creator>
      <pubDate>Sun, 24 Mar 2024 19:05:41 +0000</pubDate>
      <link>https://dev.to/ehabsmh/day-1-of-100daysofcode-hash-tables-28h8</link>
      <guid>https://dev.to/ehabsmh/day-1-of-100daysofcode-hash-tables-28h8</guid>
      <description>&lt;p&gt;&lt;strong&gt;🔍 Efficient Data Retrieval:&lt;/strong&gt; Arrays offer O(1) access, but the linear search takes O(n). Hash tables leverage hash functions for O(1) insertion and access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; hash function: Is a function that spits out the index of an available slot of the list to to insert new data or to retrieve data if data exists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Dynamic Data Management:&lt;/strong&gt; Arrays require shifting elements for insertion, while linked lists demand traversal. Hash tables, through hash functions, ensure O(1) insertion regardless of position.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔑 Key-Value Pairing:&lt;/strong&gt; Hash tables resolve the search complexity (O(n)) by associating each element with a key. A hash function maps the key to its location, facilitating rapid retrieval.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➖ Smart Removal Technique:&lt;/strong&gt; Additionally, hash tables employ intelligent removal methods. By leveraging the key, removal becomes an O(1) operation, maintaining efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔗 Collision Resolution:&lt;/strong&gt; I also explored collision scenarios where different keys map to the same location, leading to chaining and linear probing techniques. Chaining involves linking collided elements in a linked list, while linear probing explores adjacent slots for placement.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;bucket.h&lt;/em&gt;&lt;/strong&gt; (slots of the table)&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;&lt;em&gt;person.h&lt;/em&gt;&lt;/strong&gt; (value of the table)&lt;/p&gt;

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

&lt;h1&gt;
  
  
  100daysofALXSE
&lt;/h1&gt;

</description>
      <category>c</category>
      <category>datastructures</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
