What are the two methods of representing a binary tree

Assignment Help Data Structure & Algorithms
Reference no: EM13338932

Assignment: TA (Compulsory)

1.    Define an algorithm. What are the properties of an algorithm ?

2.    Write a note on  i) devising       ii) validating        and   iii) testing of algorithms.

3.    What is a linear data structure  ? Give examples. Describe how an array is represented.

4.    Write algorithms to implement the following operations on a stack -   create, push, pop.

5.    What is a first-in-first-out data structure ?  Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.

6.    What is a graph  ?  What are the two ways of representing a graph  ?  Describe with the help of illustrative examples.

7.    What is a circular queue ?  Write algorithms to implement the insertion and deletion operations.

8.    Write an algorithm to find the roots of a quadratic equation.

9.    Design an algorithm to check whether a  given string is a palindrome or not.

10.  Develop an algorithm to generate all the prime numbers between the given 2 limits.

Assignment:  TB (COMPULSORY)

PART - A

I. Say whether the following statements are true or false.

1) Definiteness is one of the properties of an algorithm.

2) Graph is a linear data structure.

3) A tree is a connected graph.

4) The data structure used by recursion is stack.

5) Queue works on the strategy "First in First out".

II. Using suitable word or phrase fill up the blanks in the following sentences:

1) _____________is the process of executing a correct program on data sets and measuring the time and space.

2) Tree is a_____________data structure.

3) For a graph with 'n' number of nodes the number of edges to form a tree is _____________

4) "Last in First out" Data structure is referred to as _____________

5) A binary tree of depth 'K' has maximum of_____________number of nodes.

6) A _____________is a graph without self loop and parallel edges.

7) The two methods of searching are_____________and_____________

III. Write brief answers to the following questions:

1) Define algorithm. What are its properties?

2) Give atleast four real life examples where we use stack operations.

3) Differentiate full and complete binary trees.

4) What are the demerits of recursion?

PART - B

1. a) What are the characteristics of an algorithm? Describe with an example.

b) Write an algorithm to implement any three operations of a queue.

2. a) Describe the two methods of representing a graph.

b) Design an algorithm to generate all prime numbers between 10 and 20.

3. a) Trace out the algorithm Max Min on a data set containing atleast 8 elements.

b) Design an algorithm to sort the elements using merge sort.

4. What are preorder, Inorder, postorder traversals of a binary tree? Design recursion algorithms to implement them and explain with the help of an example.

5. a) What is binary search? Develop a recursive algorithm for binary search.

b) What are the two methods of representing a binary tree?

6. a) Design an algorithm to check whether a given string is a palindrome or not.

b) Trace out the algorithm quick sort on the data set {1,5,7,19,15,8,9, 10}.

7. a) What is validation and testing of algorithms?

b) Explain the terms with examples

i) Finite graph

ii) Isolated and pendent vertices

iii) NULL graph

iv) Path.

8. Write short notes on :

a) Debugging

b) The need for recursion

c) Incidence matrix.

Reference no: EM13338932

Questions Cloud

Definiteness is one of the properties of an algorithm : Using suitable word or phrase fill up the blanks in the following sentences.
How much out-of-pocket payment will mr smith be responsible : How much will Medicare pay Dr. Johnson if Dr. Johnson is a Medicare participating physician? How much out-of-pocket payment will Mr. Smith be responsible for?
What are the properties of an algorithm : What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.
What is the tire pressure in pascals : An automobile tire is inflated with air originally at 10.0°C and normal atmospheric pressure. What is the tire pressure in pascals
What are the two methods of representing a binary tree : What is a first-in-first-out data structure ?  Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.
Compute how much time passes on the astronauts clocks : If astronauts could travel at v = 0.910c, we on Earth would say it takes (4.20 / 0.910) = 4.62 years to reach Alpha Centauri, 4.20 light-years away. How much time passes on the astronauts' clocks
Compare the benefits of the virtualization computing tech : Compare the benefits of the virtualization computing technology with past successful or unsuccessful telecommunications technologies you have in place. With four references.
What is the pebbles speed and acceleration : Your roommate is working on his bicycle and has the bike upside down. He spins the 70.0cm -diameter wheel, What is the pebble's speed and acceleration
Discuss the populist movement : Describe the Progressive Movement. Provide some examples of reforms during this period. Compare TR with WW regarding their contributions to the movement. Who do you think was the better president?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Design an o(v+e) time algorithm that computes

Design an O(V+E) time algorithm that computes the smallest number of batches required to complete all tasks. A task can be assigned to a batch i if and only if all tasks that are its prerequisites have already been assigned to batches 1 to (i-1).

  Creating algorithm broken into sequence of words

Katt wishes you to create an algorithm that, given a string X, determines efficiently how many ways X can be broken up into sequence of words.

  Calculate best and worst-case speedup for centralized scheme

Suppose that it doesn't take any time to allot work to process, calculate best- and worst-case speedup for centralized scheme for dynamic mapping with two processes.

  Describe the need for complex data structures

Describe the need for complex data structures and how they are used. Describe the design and application of arrays and how the array simplifies program development.

  Writing a c program

Create a C program that has a declaration in main() to store the following numbers into an array named channels: 2, 4, 5, 7, 9, 11, 13. There should be a function call to display().

  Let t be the degree of a btree

Let t be the degree of a BTree. Suppose the size of each object, including the key, stored in the tree is 90 bytes. Also, suppose the size of a BTreeNode pointer is 4 bytes.

  Finding equation has no solutions mod m

Let the equation ax = b mod m, where x is unknown and a, b and m are given. Illustrate that this equation has either no solutions mod m, or d solutions mod m.

  Determine the transmission rate

Assume two TCP connections are available over some bottleneck link of rate R bps. Both connections have a huge document to send in the similar direction over the bottleneck link

  Irected graph g = (v,e) in which edges that leave the source

Suppose that we are given a weighted, directed graph G = (V,E) in which edges that leave the source vertex s may have negative weights, all weights are nonnegative, and there are no negative-weight cycles. Argue that Dijkstra's algorithm correctly fi..

  Provide a description of the algorithm in pseudocode

Provide a description of the algorithm in pseudocode and conduct time complexity analysis of the algorithm

  Create algorithm which generates access control matrix

Create an algorithm which generates the access control matrix A for any given history matrix H of the Chinese Wall model.

  Write algorithm in pseudo code for bank account

Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

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