Articles for author: Mansi

Gray Code to Binary Conversion

Problem Statement Given a gray code, write a program to convert the given gray code to binary code. Example Example Explanation   In this, the MSB or the Most Significant Bit of the gray code will always be equal to the MSB of the binary code which in this case is 1. For changing the other bits of the gray ...

Pattern Searching with Rabin-Karp Algorithm

The Rabin-Karp algorithm uses a hash function to search for and match patterns in text. Instead of going through every character in the initial phase as the Naive String Matching Algorithm does, it filters out the characters that don’t match before comparing. What is the Rabin-Karp Algorithm? The M-character subsequences of text to be compared and the ...

Two Pointer Algorithm

A reference to an object is a pointer. In some circumstances, memory-mapped computer hardware or another value located in computer memory is the value that is stored in that object’s memory address. To put it another way, a variable with an array’s address is likewise a pointer. As an example, we estimated the size of ...

NP Hard and NP Complete Problem

The NP-hard problems are solved in polynomial time by non-deterministic machines and are difficult to find but simple to prove. NP (Nondeterministic Polynomial) is a class of decision problems in computer science where a proposed solution can be verified quickly. NP-hard problems are at least as challenging as the hardest problems in NP, and solving ...

Longest Common Prefix

The common prefix between the two most dissimilar strings is the longest common prefix for an array of strings. For instance, there is no common prefix in the array apple, ape, and zebra since the two most distinct strings in the array, “ape” and “zebra,” do not share any initial letters. In this article, we will learn about the ...

Merge K Sorted Arrays

Problem Statement k number of arrays are given, the task is to merge all the given integer arrays in such a manner that the resultant array is sorted in the runtime only. Note: arrays are of equal size. Example: Output: Explanation The array at the output is sorted by combining elements of all the three ...

How to Convert Infix to Prefix Notation?

An infix expression is one that we use regularly. A single letter or operator followed by one infix string and another infix string makes up an infix expression such as A, A + B, and (A + B) + (C – D). Therefore, there are operators between operands in this. If the operator appears in an expression before the ...

Difference between Recursion and Iteration

The set of instructions is repeated using both recursion and iteration. When a statement within a function repeatedly invokes itself, recursion occurs. Iteration happens when a loop runs repeatedly until the controlling condition is satisfied. Recursion and iteration vary fundamentally doing the same thing. iteration is used to apply a set of instructions that we want ...

Difference between Search Engine and Web Browser

The terms “web browser” and “search engine” are associated with the Internet. A web browser is an application software used to load HTML files, such as online pages, whereas a search engine is essentially a tool for accessing information on the Internet. Learn more about search engines and web browsers in this article, including how ...

Common Operations of Data Structures

People have been referring to computer information that is communicated or stored as “data” since the development of computers. On the other hand, order types also contain data. Data might take the shape of printed numbers or sentences and bytes saved in the memory of electrical devices or knowledge that has been mentally preserved. This ...