Recently Added Questions & Answers

 

==> Tower of Hanoi---

  • Tower of Hanoi, is a mathematical puzzle which consists of three tower (pegs) and more than one rings;
  • These rings are of different sizes and stacked upon in ascending order i.e. the smaller one sits over the larger one. There are other variations of puzzle where the number of disks increase, but the tower count remains the same.
 

==> Fibonacci Sequence---

        Fibonacci series 0,1,1,2,3,5,8,13,21,…..

  1. if n=0 or n=1, then Fn =n
  2. if n>1 then Fn=Fn-1+Fn-2

         fib(n)

        {

         if(n==0)

         return 0;

         if(n==1) return 1;

         else

         return( fib(n-1)+fib(n-2));

          } 

 

==> Evaluation of Postfix expression---

  • In high level languages, infix notation cannot be used to evaluate expressions
  • Instead compilers typically use a parenthesis free notation to evaluate the expression
  • A common technique is to convert a infix notation into postfix notation, then evaluating it.
  • Before knowing the function that translates infix expression to postfix expression, we need to know how to evaluate the postfix expression.                                                                                                         45+ will be evaluate as 4+5=9
  • To evaluate an expression we make single left to right scan (read) of it. We place the operands on a stack until we find an operator. We then remove, from the stack, correct number of operands for the operator, perform operation, and place the result back on the stack. We continue until we reach the end of the expression. We remove the result top of the stack.
 

==> Infix expression---

  • The expression in which operator is placed in between operands
  • Ex. a+b

==> Polish Notation---

  •  - names after the Polish Mathematician Jan Lukasiewiez, refers to the expression in which the operator is placed before the operands also called prefix expression.
  • Ex. +ab

==> Reverse Polish Notation---

  • refers to the expression in which the operator is placed after the operands also called postfix expression or suffix Expression.
  • Ex. ab+ 
 

==> Applications of Stack----

  • The simplest application of a stack is to reverse a word. You push a given word to stack - letter by letter - and then pop letters from the stack
  • Another application is an "undo" mechanism in text editors; this operation is accomplished by keeping all text changes in a stack.
  • Evaluation of Expressions
  • Language processing::
  1. space for parameters and local variables is created internally using a stack.
  2. compiler's syntax check for matching braces is implemented by using stack.
  3. support for recursion 
 

==> Stacks--

  • A stack is linear Data Sturcture in which items are added (pushed, inserted) and removed(pop, deleted) from one end called top.
  • A stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. In the stacks only two operations are allowed: push the item into the stack, and pop the item out of the stack

Jump to Page : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

Recommended Question Bank

General - Computer Science
View
- Computer organisation and architecture
View
NA - Java
View
- javascript
View
- STORAGE AREA NETWORKS
View
Mejona - Mejona Technology
View
VTU - NCES(Non - Conventional Energy Resources
View
- Java Basic Codes
View
VTU - STORAGE AREA NETWORK
View
- HIGHWAY ENGINEERING
View
- COMPUTER ORGANIZATION
View
- Quantity Surveying and Contracts Management
View
- Design of RC Structural Elements
View
- Ground Water and Hydraulic
View
- Urban Transport Planning
View
- Basic Geotechnical Engineering
View
VTU - Municipal Waste Water Engineering
View
VTU - Design of Steel Structures Elements
View
- Interview Question Bank
View
VTU - Artificial Intelligence
View
Visvesvaraya Technological University (VTU) - Ground water hydraulic
View
-
View
VTU - Artificial intelligence and Machine Learning (AIML)
View
VTU - Energy and Environment
View
VTU - User Interface Design
View
- Data Structures and Algorithms
View
VTU - Big Data Analytics
View
VTU - Engineering Chemistry
View
VTU - User Interface Design (UID)
View
Entrance Exam for job - Entrance Exam Questions
View
VTU - Elements of Civil Engineering and Mechanic
View
VTU - Computer Graphics and Visualization
View
VTU - Object Oriented Concepts
View
VTU - System Software and Compiler Design
View
VTU - Web Technology and its Applications
View
VTU - Cloud Computing and Its Applications
View