Construct a bst

Assignment Help Computer Engineering
Reference no: EM131468227

Question: 1) Write a program to create a one dimensional array at run time using a user defined function with user given number of elements into it. Also write separate functions that would allow you to insert and delete elements into/from this array at any arbitrary location.

2) WAP to add and subtract following polynomials 5x2 - 3xy + y, 2x2 - y2 + 5xy - x + y using array.

3) Write a program to create one dimensional, two dimensional and three dimensional arrays in memory and then verify the various address calculation formulae for any arbitrary element of these arrays.

4) Write a program to obtain a sparse matrix representation B for the matrix A given below

0 1 0 0 0 0
0 0 0 0 0 0
-2 0 0 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 -3 0 0 0 0
0 0 0 0 0 1

5) Write a program to create an ordered list L[d1, d2, ... dn] where each di is the name of a peripheral device, which is maintained in the alphabetical order. Write functions to

a. Insert a device dk onto the list L.

b. Delete an existing device di from L. In this case the new ordered list should be Lnew = (d1, d2, ... di-1, di+1, ... dn) with (n - 1) elements.

c. Find the length of L.

d. Update the device dj to dk and print the new list.

6) Write a program to implement a stack in an array and perform PUSH, POP, PEEP and CHANGE operations on it using functions.

7) WAP to convert the following expression to its postfix equivalent using stack

a. ((A + B )* D) ^ (E - F)

b. A + (B * C - (D / E ^ F) * G) * H Where ^: raise to the power

8) Implement a stack S of n elements using arrays. Write functions to perform PUSH and POP operations. Implement queries using push and pop functions to

a. Retrieve the mth element of the stack S from the top (m < n), leaving the stack without its top m - 1 elements.

b. Retain only the elements in the odd position of the stack and pop out all even positioned elements.

9) Implement a program to evaluate any given postfix expression. Test your program for the evaluation of the equivalent postfix form of the expression ( - (A*B)/D) ↑ C + E - F * H * I for A = 1, B = 2, D = 3, C = 14, E = 110, F = 220, H = 16.78, I = 364.621.

19) WAP to implement linear queue using array and linked list.

11) WAP to implement circular queue using array and linked list.

12) WAP to declare a priority queue using two-dimensional array, store elements and priority. Display the elements according to priority from higher to lower.

13) A deque DQUE is to be implemented using a one dimensional array of size N. Write functions to:

a. Insert and delete elements from DQUE at either ends.

b. Implement DQUE as input restricted deque.

c. Implement DQUE as output restricted deque.

14) Write a menu driven program to perform the following operations on a singly linked list.

a. Create

b. Insert

c. Delete

d. Display

e. Exit.

15) WAP to create a sorted one way linked list with n nodes. Extend the program to insert a new node at appropriate location so that order does not get disturbed.

16) WAP to create a circular list and then count the number of nodes into it.

17) WAP to implement doubly linked list having facilities to insert a node at any position and to delete a node with particular information.

18) Let X = (x1, x2, ... xn), Y = (y1, y2, ...yn) be two lists with a sorted sequence of elements. Write a program to merge the two lists together as a single list Z with m + n elements. Implement the lists using singly linked list representations.

19) Write a program which will split a circularly linked list P with n nodes into two circularly linked lists P1, P2 with the first ⌊n/2⌋ and the last n ⌊n/2⌋ nodes of the list P in them, respectively.

20) Write a menu driven program which will maintain a list of car models, their price, name of the manufacturer, engine capacity etc., as a doubly linked list. The menu should make provisions for inserting information pertaining to new car models, delete obsolete models, and update data such as price besides answering queries such as listing all car models within a price range specified by the user and listing all details given a car model.

21) WAP to evaluate a postfix expression using a linked stack implementation.

22) WAP for creation of binary tree and traverse it in Pre, Post and Inorder. Show the traversal output.

23) WAP to construct an expression tree for a given arithmetic expression, check its correctness by traversing it in inorder.

24) WAP to count the no. of leaf nodes in a binary tree.

25) Write non-recursive functions to perform the inorder, preorder and postorder traversals of a binary tree.

26) Implement a menu driven program to perform the following operations on a binary search tree:

a. Construct a BST (Construction begins from an empty tree)

b. Insert element(s) into a non empty BST

c. Delete element(s) from a non empty BST

d. Search for an element in a BST

e. Retrieve elements of the BST in the sorted order.

27) WAP to input a graph G = (V, E) as an adjacency matrix. Include functions to

a. Test if G is complete.

b. Obtain the degree of a node u, if G is undirected, and indegree and outdegree of node u if G is directed.

28) WAP to input a graph G = (V, E) as an adjacency list. Include two functions BFT and DFT to undertake breadth first traversal and depth first traversal of the graph.

29) WAP to implement Shell sort, Quick sort and heap sort for any arbitrary set of elements with the help of user defined functions.

30) Implement a binary search on an ordered list. For the list L = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ,13, 14, 15, 16, 17, 18, 19, 20} undertake search for the elements in the list {3, 18, 1, 25}. Compare the number of key comparisons made during the searches.

Reference no: EM131468227

Questions Cloud

What set of standards would technology hospital have : Many hospitals accept credit cards for payment of services. If this information is not properly protected, the holder of the credit card (the consumer).
Component of a risk management plan : Complete at least one component of a Risk Management Plan
Have you ever seen or worked for an ineffective manager : With clear, insightful critical thinking, Identify and describe a great manager. Have you ever seen or worked for an ineffective manager?
What are the major differences between the plans : What are the major differences between the plans?Betsy is considered a controlled diabetic but still uses her insurance plan frequently.
Construct a bst : Write a program to create a one dimensional array at run time using a user defined function with user given number of elements into it.
What aspects of the experience were positive : What experience (if any) have you had in working as part of a team? What aspects of the experience were positive?
Marketing phenomenon related to the marketing effort : Personal branding is a new marketing phenomeon related to the marketing effort that a person adopts in order to promote oneself in the market.
Reproductive function to research : 1. Choose one altered reproductive function to research and write a short paper (two paragraphs).
Directions-scoring and discussion questions : Directions, Scoring, and Discussion Questions. Use outside research articles to support your answers to the Discussion Questions; 2 outside sources for each DQ.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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