C program to simulate Nondeterministic Finite Automata (NFA) Background An NFA is typically described using a directed graph. Each edge and vertex is labeled either 0 or 1 representing possible transitions. Vertices represent the states of the NFA. Those labeled 0 are non accepting states, and those labeled 1 are accepting states. It takes an

# Tagtech

## 10 Most asked Questions from Java Programmers

10 Most asked Questions from Java Programmers Hope you liked my previous post “Top 25 Interview Questions”. Here comes the next 10. 1) Design discussion on elevator. Hint: Ask questions related to elevator functionality; come up with a High Level design and Low level design. Be prepared for scheduling questions related to elevator. 2) “n”

## Commonly asked Interview Questions for Front End Developers

Commonly asked Interview Questions for Front End Developers 1) CSS, JS best practices? Strict mode, etc. 2) Mention some IE CSS issues faced by developers. 3) How to defer an element’s event handler if it depends on an external script that takes some time to load? 4) Optimal strategy for winning a game where let’s

## Find the Number Occurring Odd Number of Times

Find the Number Occurring Odd Number of Times Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number in O(n) time & constant space. Example: I/P = [1, 2, 3, 2, 3, 1, 3] O/P = 3 A Simple Solution

## Given an array A[] and a number x, check for pair in A[] with sum as x

Given an array A[] and a number x, check for pair in A[] with sum as x Write a C program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S whose sum is exactly x. METHOD 1 (Use Sorting) Algorithm: hasArrayTwoCandidates (A[],

## What does ‘Space Complexity’ mean?

What does ‘Space Complexity’ mean? Space Complexity: The term Space Complexity is misused for Auxiliary Space at many places. Following are the correct definitions of Auxiliary Space and Space Complexity. Auxiliary Space is the extra space or temporary space used by an algorithm. Space Complexity of an algorithm is total space taken by the algorithm

## Analysis of Algorithm | Set 5 (Amortized Analysis Introduction)

Analysis of Algorithm | Set 5 (Amortized Analysis Introduction) Amortized Analysis is used for algorithms where an occasional operation is very slow, but most of the other operations are faster. In Amortized Analysis, we analyze a sequence of operations and guarantee a worst case average time which is lower than the worst case time of

## Analysis of Algorithms | Set 2 (Worst, Average and Best Cases)

Analysis of Algorithms | Set 2 (Worst, Average and Best Cases) In the previous post, we discussed how Asymptotic analysis overcomes the problems of naive way of analyzing algorithms. In this post, we will take an example of Linear Search and analyze it using Asymptotic analysis. We can have three cases to analyze an algorithm:

## Asymptotic Analysis

Analysis of Algorithms | Set 1 (Asymptotic Analysis) Why performance analysis? There are many important things that should be taken care of, like user friendliness, modularity, security, maintainability, etc. Why to worry about performance? The answer to this is simple, we can have all the above things only if we have performance. So performance is