For almost all choice jobs of the future – whether in engineering, natural or social sciences, economics, finance or government, one has to be familiar with the essential fundamentals of computing to understand and leverage technology in the search for scientific breakthroughs, the development of new products and services, or the way work is done in a technologically-driven society. A Computer Science degree involves well developed communication, leadership and management skills coupled with creative technical savvy. Daniel A. Reed, Professor & Director of the Institute for Renaissance Computing at the University of North Carolina at Chapel Hill and the current director of CRA (Computing Research Association – http://www.cra.org) says, “Computing has become the third pillar of science, along with theory and experiment”.
Google Search
Friday, April 29, 2016
Differences between M. Sc. in Computer Science & MCA
(After B. Sc. or BCA)
Course and Opportunities:
MSc in Computer Science covers various areas which can be applied to various areas like technology, science, business and education. A person who has done MSC computer science will have opportunities in software development, testing and networking. Companies such as Oracle, HP, Wipro, IBM, Compaq etc. are hiring people with MSC computer science qualification. A person who is very much interested in teaching computer science or doing research in the field of computer should definitely go for MSC computer science.
MCA Course and Opportunities:
MCA course is suitable for those who wish to have a career in Software. An MCA degree holder will have great job opportunities in top level IT companies and consultancy firms. A person with MCA can become Software Programmer, Software Engineer, Software Developer, Systems Analyst, Software Application Architect, and Software Consultant
Many MNC’s prefer MCA candidates than MSC candidates. MCA’s are well aware of the applications. But to develop a new one, a person with MSC computer science is required. Thus, for working purpose an MCA is preferred but for Research purpose always M.Sc.Computer Science will be preferred.
Key differentiators between MSc Computer Science and MCA:
MSc computer science is 2 years course where as MCA is a 3 year course. MCA deals with Computer application i.e. Software related. MSc computer science on the other hand deals with the theoretical details of hardware and software along with logic & algorithm. Those having a strong computational and scientific background opt for this field. The course also provides an excellent grounding for further research, either through PhD study or in a commercial setting.
Now, From my view,
MCA is in better position as you can apply all the IT jobs, Govt. and banking sector jobs and even teaching jobs and also can apply for m.tech or p.hd.as for IT firms, MCA is treated as B.Tech equivalent and for Educational Institution purposes, It considers as Masters equivalent. Where as after finishing M.Sc. in computer science, you can't apply even most of the IT firms as they don't support 2 years masters degree courses and you have to finish atleast 3+3 = 6 years (3 for B.sc/BCA + 3 for Masters) so only teaching lines and Govt.or Banking jobs are available. But it is also true that MCA is much more costlier than M.Sc. but from career aspect, You may have more options after finishing MCA. So think twice before decide.!
All the best.
Friday, April 22, 2016
Kruskal’s Algorithm for Minimum Spanning Tree
Kruskal's algorithm is a greedy algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. If the graph is not connected, then it finds a minimum spanning forest (a minimum spanning tree for each connected component).
Pseudo Code for Kruskal’s Algorithm:
==============================
==============================
1. T (the final spanning tree) is defined to be the empty set;
2. For each vertex v of G, make the empty set out of v;
3. Sort the edges of G in ascending (non-decreasing) order;
4. For each edge (u, v) from the sored list of step 3.
If u and v belong to different sets
Add (u,v) to T;
Get together u and v in one single set;
5. Return T
2. For each vertex v of G, make the empty set out of v;
3. Sort the edges of G in ascending (non-decreasing) order;
4. For each edge (u, v) from the sored list of step 3.
If u and v belong to different sets
Add (u,v) to T;
Get together u and v in one single set;
5. Return T
Context-Free Grammer
Definition − A context-free grammar (CFG) consisting of a finite set of grammar rules is a quadruple (N, T, P, S) where
--N is a set of non-terminal symbols.
--T is a set of terminals where N ∩ T = NULL.
--P is a set of rules, P: N → (N ∪ T)*, i.e., the left-hand side of the production rule P does have any right context or left context.
--S is the start symbol.
Example:
------------
The grammar ({A}, {a, b, c}, P, A), P : A → aA, A → abc.
The grammar ({S, a, b}, {a, b}, P, S), P: S → aSa, S → bSb, S → ε
The grammar ({S, F}, {0, 1}, P, S), P: S → 00S | 11F, F → 00F | ε
------------
The grammar ({A}, {a, b, c}, P, A), P : A → aA, A → abc.
The grammar ({S, a, b}, {a, b}, P, S), P: S → aSa, S → bSb, S → ε
The grammar ({S, F}, {0, 1}, P, S), P: S → 00S | 11F, F → 00F | ε
Chomsky Normal Form (Context Free Grammar)
A CFG is in Chomsky Normal Form if the Productions are in the following forms −
A → a
A → BC
S → ε
where A, B, and C are non-terminals and a is terminal.
A → BC
S → ε
where A, B, and C are non-terminals and a is terminal.
Algorithm to Convert into Chomsky Normal Form −
Step 1 If the start symbol S occurs on some right side, create a new start symbol S’ and a new production S’ → S.
Step 2 Remove Null productions. (Using the Null production removal algorithm discussed earlier)
Step 3 Remove unit productions. (Using the Unit production removal algorithm discussed earlier)
Step 4 Replace each production A → B1…Bn where n > 2 with A → B1C where C → B2 …Bn. Repeat this step for all productions having two or more symbols in the right side.
Step 5 If the right side of any production is in the form A → aB where a is a terminal and A, B are non-terminal, then the production is replaced by A → XB and X → a. Repeat this step for every production which is in the form A → aB.
Problem
Convert the following CFG into CNF
Step 1 If the start symbol S occurs on some right side, create a new start symbol S’ and a new production S’ → S.
Step 2 Remove Null productions. (Using the Null production removal algorithm discussed earlier)
Step 3 Remove unit productions. (Using the Unit production removal algorithm discussed earlier)
Step 4 Replace each production A → B1…Bn where n > 2 with A → B1C where C → B2 …Bn. Repeat this step for all productions having two or more symbols in the right side.
Step 5 If the right side of any production is in the form A → aB where a is a terminal and A, B are non-terminal, then the production is replaced by A → XB and X → a. Repeat this step for every production which is in the form A → aB.
Problem
Convert the following CFG into CNF
S → ASA | aB, A → B | S, B → b | ∈
Solution
(1) Since S appears in R.H.S, we add a new state S0 and S0 → S is added to the production set and it becomes −
(1) Since S appears in R.H.S, we add a new state S0 and S0 → S is added to the production set and it becomes −
S0 → S, S → ASA | aB, A → B | S, B → b | ε
(2) Now we will remove the null productions −
B → ε and A → ε
After removing B → ε, the production set becomes −
S0 → S, S → ASA | aB | a, A → B | S | ε, B → b
After removing A → ε, the production set becomes −
S0 → S, S → ASA | aB | a | AS | SA | S, A → B | S, B → b
(3) Now we will remove the unit productions.
After removing S → S, the production set becomes −
S0 → S, S → ASA | aB | a | AS | SA, A → B | S, B → b
After removing S0 → S, the production set becomes −
S0 → ASA | aB | a | AS | SA, S → ASA | aB | a | AS | SA
A → B | S, B → b
After removing A → B, the production set becomes −
S0 → ASA | aB | a | AS | SA, S → ASA | aB | a | AS | SA
A → S | b
B → b
After removing A → S, the production set becomes −
S0 → ASA | aB | a | AS | SA, S → ASA | aB | a | AS | SA
A → b |ASA | aB | a | AS | SA, B → b
(4) Now we will find out more than two variables in the R.H.S
Here, S0 → ASA, S → ASA, A → ASA violates two Non-terminals in R.H.S.
Hence we will apply step 4 and step 5 to get the following final production set which is in CNF −
S0 → AX | aB | a | AS | SA
S → AX | aB | a | AS | SA
A → b |AX | aB | a | AS | SA
B → b
X → SA
(5) We have to change the productions S0 → aB, S → aB, A → aB
And the final production set becomes −
S0 → AX | YB | a | AS | SA
S → AX | YB | a | AS | SA
A → b |AX | YB | a | AS | SA
B → b
X → SA
Y → a
What is the running time of Radix Sort?
Let there be d digits in input integers. Radix Sort takes O(d*(n+b)) time where b is the base for representing numbers, for example, for decimal system, b is 10. What is the value of d? If k is the maximum possible value, then d would be O(logb(k)). So overall time complexity is O((n+b) * logb(k)). Which looks more than the time complexity of comparison based sorting algorithms for a large k. Let us first limit k. Let k <= nc where c is a constant. In that case, the complexity becomes O(nLogb(n)). But it still doesn’t beat comparison based sorting algorithms.
What if we make value of b larger?. What should be the value of b to make the time complexity linear? If we set b as n, we get the time complexity as O(n). In other words, we can sort an array of integers with range from 1 to nc if the numbers are represented in base n (or every digit takes log2(n) bits).
What if we make value of b larger?. What should be the value of b to make the time complexity linear? If we set b as n, we get the time complexity as O(n). In other words, we can sort an array of integers with range from 1 to nc if the numbers are represented in base n (or every digit takes log2(n) bits).
Subscribe to:
Posts (Atom)