Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Computer Programming Articles
Found 177 articles
Difference Between Linear Search and Binary Search
A linear search compares the target element with each array element, while a binary search uses divide-and-conquer method to efficiently search for the target element. In this article, we will compare linear search and binary search. What is Linear Search? Linear search is a sequential searching algorithm where we traverse every element within the input array and compare it with the target element to be found. If the target element is found, we return true and the index, and return false if the element is not found in the given array. Below is an animation of working of linear ...
Read MoreDifference Between Structure and Class
In C++, both structures (struct) and classes (class) are user-defined data types, where they both give access to group different data elements (variables) and functions together. However, they still possess a few differences between them. In this article, we will see and go through its differences. Structure (struct) The struct is a user-defined data type, which allows the grouping of variables of different data types, with the members being public by default. This is commonly used to represent simple data structures, where encapsulation is not necessary. A struct can contain data members and member functions, but its primary use is ...
Read MoreDifference Between int and long
In programming, int and long are the part of primitive data type. The int stores the integer value while long stores the larger range of values like a whole number. In this article, we will see the differences between int and long data types. int (Integer) Data Type The keyword int representing the integer value. It store the both positive and negative values such as -1, 45, -78, 85, etc., but not fractional and decimal values. The value ranges from –2, 147, 483, 648 to 2, 147, 483, 647. Behavior of int in Different Languages Following is the list of ...
Read MoreMost Asked Problems on Queue Data Structure in Programming Interviews
A Queue is the data structure used to store and manage the data in a specific order by following the principle of First In First Out (FIFO). The article "Most Asked Problems on Queue Data Structure in Programming Interviews" benefits you by providing good examples of every problem of the tree. It provides the problems from the basic to the hard level. It covers the core and important problems of Queue.Here is the list of queue problems to excel in the ...
Read MoreMost Asked Problems on Recursion Algorithm in Coding Interviews
Recursion Algorithm in Data Structure and Algorithms is used to call the function by itself. The article "Most Asked Problems on Recursion Algorithm in Coding Interviews" benefits you by providing good examples of every problem of the recursion. It provides the problems from the basic to the hard level. It covers the core and important problems of the recursion algorithm. The following are the main problems with the recursion algorithm − Easy Recursion Problems Print Pattern Recursively ...
Read MoreTop 50 Dynamic Programming Coding Problems for Interviews
Dynamic Programming in Data Structures and Algorithms is used for breaking down the main problems into smaller problems. This article also breaks down all the problems into different sections which will help you to solve the problems section-wise. It includes the most common and trending problems of dynamic programming for clearing the interviews. Here are the problems list from beginner to expert level for learning the DP − Beginner DP Problems Climbing Stairs House Robber Maximum Subarray Coin Change Best Time to Buy and Sell Stock Pascal's Triangle Range Sum Query Fibonacci Number Min Cost Climbing Stairs Maximum Profit ...
Read MoreWhat is the difference between One-Pass Compiler and Multi-Pass Compiler?
One-Pass CompilerOne pass compiler reads the code only once and then translates it. The one-pass compiler passes only once through the parts of each compilation unit. It can translate each part into its final machine program. In the one-pass compiler, when the line source is processed, it is scanned and the token is extracted. This is in contrast to a multi-pass compiler which modifies the program into one or more intermediate representations in steps between source program and machine program, and which convert the whole compilation unit in each sequential pass.A one-pass compiler is fast since all the compiler code ...
Read MoreWhat is the difference between Compiler and Interpreter?
Both compilers and interpreters are the language processors used to convert software codes written in high-level language into machine language codes. Compilers and interpreters are types of system software. They are required because a computer cannot process a code written in high-level programming language like C, C++, Java, etc. Therefore, we convert a HLL code into machine code for execution. In this article, we will highlight all the major differences between a compiler and an interpreter. Let's start with some basics so that it will become easier to understand their differences. What is a Compiler? A language processor ...
Read MoreDifference Between Assembler and Interpreter
The assembler and interpreter are responsible for the execution of a program. The assembler converts the code written in an assembly language into the machine code. Interpreters execute the code directly in a sequential order. In this article, we will discuss the difference between assembler and interpreter. What is an Assembler? An assembly language consists of mnemonics to write code in human-readable language. These mnemonics are GO, HALT, JUMP, NOT, and many more. An assembler is used to translate the code written in assembly language into machine language which could be understood by the machine. Types of Assemblers Assemblers are ...
Read MoreConstruct a Predictive Parsing table for the following grammar & also check whether string \\nid + id * id is accepted or not.
Problem − Consider the following grammar − E → TE′ E′ → +TE′|ε T′ → FT′ T′ → FT′|ε F → (E)|id Solution − Step1− Elimination of Left Recursion & perform Left Factoring As there is no left recursion in Grammar so, we will proceed as it is. Also, there is no need for Left Factoring. Step2− Computation of FIRST FIRST(E) = FIRST(T) = FIRST(F) = {(, id} FIRST (E′) = {+, ε} FIRST (T′) = {*, ε} Step3− Computation of FOLLOW FOLLOW (E) = FOLLOW(E′) = {), $} FOLLOW (T) = FOLLOW(T′) = {+, ), $} FOLLOW (F) = ...
Read More