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
-
Economics & Finance
Programming Languages Articles
Page 5 of 18
Program to find a Score of a String
The Score of a String is a concept which is used to calculate the score based on the sum of the absolute differences between the ASCII values of adjacent characters in the string. Problem Statement Given a string s, calculate the score of the string. The score is defined as the sum of the absolute differences between the ASCII values of adjacent characters. Example Scenario 1 Input: s="abc" Output: 2 The ASCII values of the characters in s are 'a' = 97, 'b' = 98, 'c' = 99. So, the score of s = |97-98|+|98-99|= 1+1 ...
Read MoreDifference between Scripting and Programming Languages
There are different types of computer languages which are used to make various types of software applications. In this article, we will talk about the difference between scripting and programming languages. Scripting Language Scripting language is a programming language in which a program is interpreted at runtime. The process of compiling is not performed in these languages. Scripting languages are used to establish communication between different programming languages. Types of Scripting Languages Scripting languages are of two types which include server side and client side. Server Side Scripts Server-side scripts are developed in such a way that they work at ...
Read MoreHastebin Alternatives
What is Hastebin? Hastebin is a website which users can use to write text and code snippets and store them to share with other users with the help of a URL. Users like the website because of its simple user interface. It consists of different commands that you can use to make a new text snippet, store the one on which you are working, and open the existing ones for editing. Snippets are formatted by Markdown by default but you can use the Just Text command to use plain text. How to choose a Hastebin Alternative? There are many advantages ...
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 MoreWhat is LEX?
It is a tool or software which automatically generates a lexical analyzer (finite Automata). It takes as its input a LEX source program and produces lexical Analyzer as its output. Lexical Analyzer will convert the input string entered by the user into tokens as its output.LEX is a program generator designed for lexical processing of character input/output stream. Anything from simple text search program that looks for pattern in its input-output file to a C compiler that transforms a program into optimized code.In program with structure input-output two tasks occurs over and over. It can divide the input-output into meaningful ...
Read MoreWhat is Input Buffering in Compiler Design?
Lexical Analysis has to access secondary memory each time to identify tokens. It is time-consuming and costly. So, the input strings are stored into a buffer and then scanned by Lexical Analysis.Lexical Analysis scans input string from left to right one character at a time to identify tokens. It uses two pointers to scan tokens −Begin Pointer (bptr) − It points to the beginning of the string to be read.Look Ahead Pointer (lptr) − It moves ahead to search for the end of the token.Example − For statement int a, b;Both pointers start at the beginning of the string, which ...
Read MoreWhat is techniques of storage allocation in compiler design?
There are various storage allocation techniques are as follows −Static AllocationIt is the simplest allocation scheme in which allocation of data objects is done at compile time because the size of every data item can be determined by the compiler.Recursive Subprogram and Arrays of adjustable length are not permitted in a language. In static allocation, the compiler can decide the amount of storage needed by each data object. Thus, it becomes easy for a compiler to identify the address of these data in the activation record.FORTRAN uses this kind of storage allocation strategies.AdvantagesIt is easy to implement.It allows type checking ...
Read MoreWhat is Syntax Tree?
Tree in which each leaf node describes an operand & each interior node an operator. The syntax tree is shortened form of the Parse Tree.Example1 − Draw Syntax Tree for the string a + b ∗ c − d.Rules for constructing a syntax treeEach node in a syntax tree can be executed as data with multiple fields. In the node for an operator, one field recognizes the operator and the remaining field includes a pointer to the nodes for the operands. The operator is known as the label of the node. The following functions are used to create the nodes ...
Read MoreDevDocs Alternatives
What is DevDocs? DevDocs is a tool which consists of documentation of different programming languages which software developers can use. They do not have to navigate to different websites as all documentations will be available on this single website. The app also has a mobile version along with some more features like keyboard shortcuts, a dark theme, etc. A search bar is available which can be used to search the required information. Why DevDocs alternatives? The platform does not have any cons. How to choose a DevDocs Alternative? Access the platform to access documentation for different technologies. The user ...
Read MoreReplit Alternatives
What is Replit? Replit is an online platform and you can use it to create a lot of projects. You need to do an easy setup to create projects. It is a platform where programs can be created and executed in 50 programming languages. The platform also consists of many programming courses which you can avail to enhance your knowledge. You need to create an account to use the features of Replit. The account can be created by using Google, GitHub, and Facebook or there is also an option of creating your own username and password. Price Plans of Replit ...
Read More