Specify the value of p when the stack is empty

Assignment Help Other Engineering
Reference no: EM131094298

Q.1 Let P be a pointer to a singly linked list. Show how this list may be used as a stack. That is, write algorithms to push and pop elements. Specify the value of P when the stack is empty.

Q.2 What is an algorithm? What are the characteristics of a good algorithm?

Q.3 How do you find the complexity of an algorithm? What is the relation between the time and space complexities of an algorithm? Justify your answer with an example.

Q.4 Explain an efficient way of storing a sparse matrix in memory. Write a module to find the transpose of a sparse matrix stored in this way.

Q.5 Explain an efficient way of storing two symmetric matrices of the same order in memory.

Q.6 Write an algorithm to evaluate a postfix expression. Execute your algorithm using the following postfix expression as your input : a b + c d +*f↑ .Ans:

Q.7 What are circular queues? Write down routines for inserting and deleting elements from a circular queue implemented using arrays.

Q.8 Given a set of input representing the nodes of a binary tree, write a non recursive algorithm that must be able to output the three traversal orders. Write an algorithm for checking validity of the input, i.e., the program must know if the input is disjoint, duplicated and has a loop.

Q.9 Two linked lists contain information of the same type in ascending order. Write a module to merge them to a single linked list that is sorted.

Q.10 What is a Binary Search Tree (BST)? Make a BST for the following sequence of numbers.45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48 Traverse the tree in Preorder, Inorder and postorder.

Q.11 What are expression trees? Represent the following expression using a tree. Comment on the result ((c*d)+e)

Q.12 How do you rotate a Binary Tree? Explain right and left rotations with the help of an example.

Q.13 Taking a suitable example explains how a general tree can be represented as a Binary Tree.

Q.14 What are the different ways of representing a graph? Represent the following graph using those ways.

1118_Untitled.png

Q.15 Show the result of running BFS and DFS on the directed graph given below using vertex 3 as source. Show the status of the data structure used at each stage.

58_Untitled.png

Q.16 Write an algorithm for finding solution to the Tower’s of Hanoi problem. Explain the working of your algorithm (with 4 disks) with diagrams.

Q.17 Reverse the order of elements on a stack S

(i) using two additional stacks.

(ii) using one additional queue.

Q.18 Explain the representations of graph. Represent the given graph using any two methods

254_Untitled.png

Q.19 Write short notes on any FOUR:-

(i) B Tree.

(ii) Time Complexity, Big O notation.

(iii) Merge Sort.

(iv) Threaded Binary Tree.

(v) Depth First Traversal.

Q.20 Define the term array. How are two-dimensional arrays represented in memory? Explain how address of an element is calculated in a two dimensional array.

Q.21 An, array, A contains n unique integers from the range x to y (x and y inclusive where n=y-). That is, there is one member that is not in A. Design an O(n) time algorithm for finding that number.

Q.22 Explain how to implement two stacks in one array A[1..n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. The PUSH and POP operations should run in O(1) time.

Q.23 What are stacks? How can stacks be used to check whether an expression is correctly parenthized or not. For eg(()) is well formed but (() or )()( is not.

Q24. Write down any four applications of queues.

Q.25 Define a B-Tree.

Reference no: EM131094298

Questions Cloud

Characteristics of statistics data : What are some of the most important characteristics of statistics data?
Eight operations performed in the region : She would like to be accurate within + or - 6 min. Only 420 such operations have been performed  nationwide. For the eight operations performed in the region of Mercy Hospital, X bar= 3.20 hr. and s = .30 hr. The analyst plans to take a random sam..
What are some of the vitiating factors in law of contract : What are some of the vitiating factors in law of contract? List them briefly. Any four factors. You can answer in prise form if you find it suitable.
Would the business judgment rule protect donald trump : What would the default be if you did not have an express agreement and did not choose a specific form of business organization? What liability would you have for any contracts or torts done for the benefit of and in the course of the business?
Specify the value of p when the stack is empty : Let P be a pointer to a singly linked list. Show how this list may be used as a stack. That is, write algorithms to push and pop elements. Specify the value of P when the stack is empty.
Write a program that extends the bankaccount class : To verify the banks total, read the file and write a program using a CarLoan class that extends the BankAccount class (found on page 671 - 672 in the textbook).
Probability of getting any one of combinations : A person enters a grocery store to shop. There are 15 different brands of cereal and they select 3, one for the next 3 days with order being important. They have 2,730 different combinations. What is the probability of getting ANY ONE of the co..
Will planter succeed in his claim : After a month Planter asked for the return of his car within three days, or payment of $10 000. The car was returned a week later but it was badly damaged after a collision while being used by employees of Baskerville without permission. Planter r..
Write about trial balance and its purpose : Write about Trial balance and its purpose Journalizing the transactions of KD dispensary

Reviews

Write a Review

Other Engineering Questions & Answers

  Find vov and id at which the transistors must be operating

Assume that the bandwidth of the cascode amplifier is primarily determined by the input circuit. If Cgd = 0.1Cgs and the dc gain of the CS amplifier is 50, what is the value of N?

  Determine modulation index and frequency of upper sideband

For this circuit determine the Modulation index, Vc, Vm, fc (frequency of carrier), fLSB (frequency of lower sideband) and fUSB (frequency of upper sideband).

  Design a real time flood monitoring system

Design a Real Time Flood Monitoring System based on Arduino Microcontroller.The system should monitor flood related information like Water level and Precipitation.The data collected from the sensors should be transferred to a client application via i..

  Find minimized sop logic expression having inputs a-b-c

A city council has three members, A, B, and C. Each member votes on a proposition (1 for yes, 0 for no). Find a minimized SOP logic expression having inputs A,B, and C and output X that is high when the majority vote is yes and low otherwise. Show..

  Determine the angle a and the tension

A uniform plate girder weighing 6000 lb is held in a horizontal position by two crane cables. Determine the angle a and the tension in each cable.

  What is the acceleration

A 15 kg steel container has 1.75 kilo moles of liquid propane inside. A force of 2 kN now accelerates this system. What is the acceleration?

  Analyze energy and economic performance

Start reading about your Sun Shot homework on the Sun Shot website - Provide a complete as possible analysis of your assigned Sun Shot initiative homework.

  Determining the fluid in rigid-body motion

The tank of liquid in the figure accelerates to the right with the fluid in rigid-body motion.

  Prepare the irb process

On the Institutional Review Board iGuide site, you will find all of the information you need regarding the IRB process.

  Distance affecting team dynamics and performance

The Vigilance Project-Case Overview 2 © 2008 SHRM. Peter G. Dominick, Ph.D. Case Overview/Synopsis This case follows a project team as they work to implement a safety database tracking system within a major international pharmaceutical company. Th..

  Shift and rotate instructions and jump instructions

Discuss the different shift and rotate instructions. Discuss how they work and the operands used.

  Summarize the sensory pathways to the brain for gustatory

Summarize the sensory pathways to the brain for gustatory and olfactory sensations.Analyze and describe the process of hearing from the external to inner ear.Analyze and describe how the ear provides equilibrium and balance for the body.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd