<?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: Bhavana</title>
    <description>The latest articles on DEV Community by Bhavana (@bhavana).</description>
    <link>https://dev.to/bhavana</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%2F626535%2F90b628c4-1e06-43cf-9ed9-bf42ac5ed7a3.png</url>
      <title>DEV Community: Bhavana</title>
      <link>https://dev.to/bhavana</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhavana"/>
    <language>en</language>
    <item>
      <title>Hashing </title>
      <dc:creator>Bhavana</dc:creator>
      <pubDate>Mon, 25 Oct 2021 05:23:58 +0000</pubDate>
      <link>https://dev.to/bhavana/hashing-nbh</link>
      <guid>https://dev.to/bhavana/hashing-nbh</guid>
      <description>&lt;p&gt;DEFINITION:&lt;br&gt;
A hash table is a special collection that is used to store key-value items. So&lt;br&gt;
instead of storing just one value like the stack, array list and queue, the&lt;br&gt;
hash table stores 2 values. These 2 values form an element of the hash&lt;br&gt;
table.&lt;/p&gt;

&lt;p&gt;Do C have a built in hash table:&lt;br&gt;
In C we only have indexed arrays to work with. Thus to make a hash table&lt;br&gt;
we will need to retrieve data with functions that use indexed arrays.&lt;/p&gt;

&lt;p&gt;*HASHING:&lt;br&gt;
Hashing is an efficient method to store and retrieve elements.&lt;br&gt;
It’s exactly same as index page of a book. In index page, every topic is&lt;br&gt;
associated with a page number. If we want to look some topic, we can&lt;br&gt;
directly get the page number from the index.&lt;/p&gt;

&lt;p&gt;How to calculate the hash key? Let’s take hash table size as 7.&lt;br&gt;
size = 7 arr[size];&lt;br&gt;
Formula:&lt;br&gt;
key = element % size&lt;/p&gt;

&lt;p&gt;*INITIALIZATION OF THE HASH BUCKET&lt;br&gt;
Before inserting elements into array. Let’s make array default value as -1.&lt;br&gt;
-1 indicates element not present or the particular index is available to&lt;br&gt;
insert.&lt;/p&gt;

&lt;p&gt;*INSERTING ELEMENTS&lt;/p&gt;

&lt;p&gt;INSERTED 24&lt;/p&gt;

&lt;p&gt;INSERTED 8&lt;/p&gt;

&lt;p&gt;*What if we insert an element say 15 to existing hash table?&lt;br&gt;
Insert : 15&lt;br&gt;
Key = element % key&lt;br&gt;
Key = 15 % 7&lt;br&gt;
Key = 1&lt;br&gt;
But already arr[1] has element 8 !&lt;br&gt;
Here, two or more different elements pointing to the same index under&lt;br&gt;
modulo size. This is called collision.&lt;/p&gt;

&lt;p&gt;*IMPLEMENTATION OF HASH PROGRAM&lt;br&gt;
Create an array of structure, data (i.e a hash table).&lt;br&gt;
Take a key to be stored in hash table as input.&lt;br&gt;
Corresponding to the key, an index will be generated.&lt;br&gt;
*BASIC OPERATION OF A HASH TABLE&lt;br&gt;
searches ,inserts and deletes an element from the hash table&lt;/p&gt;

&lt;p&gt;*USES:&lt;br&gt;
to compute an index ,also called hash code ,into an array of buckets or&lt;br&gt;
slots from which the desired location can be found&lt;br&gt;
*ADVANTAGES:&lt;br&gt;
Synchronization&lt;br&gt;
In many situations, hash tables turn out to be more efficient than search&lt;br&gt;
trees or any other table lookup structure. For this reason, they are widely&lt;br&gt;
used in many kinds of computer software's, particularly for associative&lt;br&gt;
arrays, database indexing, caches and sets.&lt;/p&gt;

&lt;p&gt;*DISADVANTAGES:&lt;br&gt;
Hash collisions Hash tables becomes quite in efficient when there are&lt;br&gt;
many collisions Hash tables does not all&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ALGORITHM of Infix to Postfix Conversion Using Stack.</title>
      <dc:creator>Bhavana</dc:creator>
      <pubDate>Thu, 06 May 2021 11:52:11 +0000</pubDate>
      <link>https://dev.to/bhavana/algorithm-of-infix-to-postfix-conversion-using-stack-1j48</link>
      <guid>https://dev.to/bhavana/algorithm-of-infix-to-postfix-conversion-using-stack-1j48</guid>
      <description>&lt;p&gt;Postfix expression: The expression of a b op. when an operator is followed for every pair of operands.&lt;/p&gt;

&lt;p&gt;Infix expression: The expression of the from a op b. when an operator is in between every pair of operands&lt;/p&gt;

&lt;p&gt;ALGORITHM&lt;/p&gt;

&lt;p&gt;step1: First we should scan the infix expression from left to right&lt;/p&gt;

&lt;p&gt;step2: If scanned character is an operand ,we should get the output.&lt;/p&gt;

&lt;p&gt;step3:Else,pop all the operators in the stack which are greater than or equal to in precedence than that of the scanned operator to the stack&lt;/p&gt;

&lt;p&gt;step4: If the scanned character is an ’ ( ', push it to the stack.&lt;/p&gt;

&lt;p&gt;step5 : If the scanned character is an ‘)’,pop the stack an output it until it is encountered, and discard both the parenthesis.&lt;/p&gt;

&lt;p&gt;step 6: Repeat steps 2-6 until infix expression is scanned.&lt;/p&gt;

&lt;p&gt;step7: print the output&lt;/p&gt;

&lt;p&gt;step 8: pop and output from the stack until it is not empty&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>postfix</category>
    </item>
    <item>
      <title>BACKTRACKING</title>
      <dc:creator>Bhavana</dc:creator>
      <pubDate>Thu, 06 May 2021 11:41:55 +0000</pubDate>
      <link>https://dev.to/bhavana/backtracking-2ch5</link>
      <guid>https://dev.to/bhavana/backtracking-2ch5</guid>
      <description>&lt;p&gt;Many problems which deal with searching for a set of solutions or for a optimal solution satisfying some constraints can be solved using the backtracking formulation.&lt;/p&gt;

&lt;p&gt;To apply backtracking method, the desired solution must be expressible as an n-tuple (X1…Xn) where Xi is chosen from some finite set Si.&lt;/p&gt;

&lt;p&gt;Often the problem to be solved calls for finding one vector that maximizes (or minimizes or satisfies) a criteria function P(X1,X2, --- Xn). Sometimes it seeks all vectors that satisfy P.&lt;/p&gt;

&lt;p&gt;Suppose mi is the size of set Si. Then the number of n-tuples may satisfy the criteria function P(x1,x2,---,xn) are m=m1,m2,---mn. The brute force approach would be to form all these n-tuples, evaluates each one with P, and save those which yield the optimum and save those which yield optimum.&lt;/p&gt;

&lt;p&gt;In backtracking we will get the same answer but fewer than m trials. Its basic idea is to build up the solution vector one component at a time and to use modified criteria function P(x1,x2, ---xi) (sometimes called bounding functions) to test whether the vector being formed has any chance of success.&lt;/p&gt;

&lt;p&gt;The major advantage of this method is if it is realized that the partial vector (x1,x2,---xi) can no way lead to an optimal solution, then mi+1….mn possible test vectors can be ignored entirely.&lt;/p&gt;

&lt;p&gt;Many problems solved using backtracking require that all the solutions satisfy a complex set of constraints. These constraints are classified as&lt;br&gt;
1.Explicit constraints&lt;br&gt;
2.Implicit constraints&lt;/p&gt;

</description>
      <category>daa</category>
      <category>backtracking</category>
    </item>
  </channel>
</rss>
