## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

UNIT –VI Linear DataStructures : Introduction to DataStructures, representing stacks and queues in C using arrays, Infix, Postfix and Prefix programs, circular queues

5. 5.

Write a routine reduce that accepts an infix string and forms an equivalent infix string with all superfluous parentheses removed. Write a recursive function that accepts a prefix expression consisting of binary operators and single-digit integer operands and returns the value of expression Write a program in C to convert a given infix expression into its postfix equivalent. Distinguish between sequential and linked allocation for representing linear lists.

4.a) b)

4. 5. 5. 5. 5. 7.

Write a C program that uses a stack to convert a given infix expression into its postfix form. Declare two stacks of varying length in a single array. Write C routines push1, push2, pop1 and pop2 to manipulate the two stacks. Declare two stacks of varying length in a single array. Write C routines push1, push2, pop1 and pop2 to manipulate the two stacks. Write a program to convert a given prefix expression to postfix expression using stacks. Write a program to convert a given postfix expression to prefix expression using stacks. Give the storage representation of following list using adjacency matrix and list structure a) (a,(b,(c,d)),e,f) b) ((x),y,A,z) where A= (a,b,(c,d))

_________________________________________________________________________

Computer Programming and Data structures

1

**C PROGRAMMING AND DATA STRUCTURES Important Questions _________________________________________________________________________
**

UNIT – VII Linked Lists : Singly linked list, Doubly linked list, Circular List, representing stacks and Queues in C using linked lists Non-Linear Data Structures : Binary trees: Representation, tree traversals, graph representation, graph traversal, Spanning trees.

7. 6. 6. 6. 7. 6.

Explain the representation of graph using adjacency matrix. Give the necessary algorithm. Write a function in ‘C’ to form a list containing the union of the elements of two lists. Write a function in ‘C’ to form a list containing the intersection of the elements of two lists. Write a function in ‘C’ to insert an element after the nth element of a list Write and explain the breath first traversal and depth first traversal in a graph with algorithm How can a polynomial in three variables (x,y and z) be represented by a singly linked list? Each node should represent a term and should contain the powers of x, y, and z as well as coefficient of that term. Write a C program to add two such polynomials. Write notes on spanning tree. Write and explain the algorithm for minimal cost. Write C functions to perform the following operations: (i) insert an integer into deque (ii) delete an integer from deque. Write a recursive function in C to find the greatest common divisor of two given positive integers. Explain with a suitable example how a binary tree in threaded. Explain with an example how the deletion operation is performed on a binary search tree. Write a C function to copy a binary tree. Write notes on any TWO of the following: a) Collison resolution techniques in Hashing b) Spanning trees c) Traversals of a binary tree. Explain the different ways of representing the graphs in the memory. Write an algorithm (or C program) for breadth first search of a given graph. Distinguish between sequential and linked allocation for representing linear list. Write a C function to reverse a linked list with first node pointed to by list. Do not copy the list elements; rather, reset links and pointers so that list points to the last node and all links between nodes are reversed. Write a C Program to exchange two nodes of a singly linked list.

7. 3.a) b) 5.a) b) c) 8.

6.a) b) 3.a) b)

6.

_________________________________________________________________________

Computer Programming and Data structures

2

C PROGRAMMING AND DATA STRUCTURES Important Questions _________________________________________________________________________

6.

Represent a doubly linked list using an array. Write routines to inset and delete elements for this representation.

6.

6.a) b)

**Write a routine to concatenate two doubly linked lists.
**

Write recursive functions in C for preorder and post order traversals of a binary tree. Explain with an example how an element is deleted from a binary search tree.

6.

Write a routine to concatenate two singly linked lists.

5. 6. 6. 7.

Write a program to evaluate a postfix expression using stack. Write a function in ‘C’ to combine two ordered lists in to a single ordered list. Write a function in ‘C’ to remove duplicate elements in a singly linked list. Write an algorithm for determining whether two binary trees A and B are similar based on the traversal method.

7.

7. 7.a) b) 7.

**Formulate non-recursive and recursive algorithm for converse in order traversal of binary tree.
**

Formulate non-recursive and recursive algorithm for Postorder traversal of binary tree. Explain the different ways of representing graphs in memory. Write an algorithm for depth first search of a given graph. Formulate non-recursive and recursive algorithm for converse in order traversal of binary tree.

7.

6. 6.

**Explain the preorder sequential representation and postorder sequential representation of a binary tree with example.
**

Write a C Program to exchange two nodes of a singly linked list. Write a function in ‘C’ for a singly linked list, which reverses the direction of links.

_________________________________________________________________________

Computer Programming and Data structures

3

C PROGRAMMING AND DATA STRUCTURES Important Questions _________________________________________________________________________

7.

Formulate non-recursive and recursive algorithm for converse in order traversal of binary tree. Formulate non-recursive and recursive algorithm for preorder traversal of binary tree.

7.

7.

**Formulate non-recursive and recursive algorithm for preorder traversal of binary tree.
**

Write a recursive function in C to find the greatest common divisor of two integers. Write C functions for insertion and deletion operations for a queue implemented as a linked list. Declare deque of integers where left and right indicate two ends. Write routines remvleft, remvright, insrtleft, insrtright to remove and insert elements at left and right ends of deque.

5.a) b)

5.

5. Define input-restricted deque as deque in which insertion is restricted to one end and deletion can be made at either end. Write routines to implement operations on this deque. 5. Define output-restricted deque as deque in which deletion is restricted to one end and insertion can be made at either end. Write routines to implement operations on this deque.

5. 6. 7.

Write a routine REVERSEQ that will reverse all elements in a queue . Represent a circular linked list using an array. Write routines to insert and delete elements for this representation. Formulate non-recursive and recursive algorithm for Postorder traversal of binary tree.

_________________________________________________________________________

Computer Programming and Data structures

4

UNIT – VIII Sorting & Searching : Searching Methods- Linear and binary search methods, Sorting methodsEx: Bubble sort, Selection sort, Insertion sort, heap sort, quick sort.

8. 8.a)

Explain heap sort with example. Write necessary algorithms. By hand, trace the action of heap sort on the following lists. Draw the initial tree to which the list corresponds. Show how it is converted into heap and show how the resulting heap as each entry is removed from the top and the new entry inserted. 12 20 34 27 30 36 23 Discuss the advantages and disadvantage of all sorting techniques with example. Trace through the steps by hand to sort the following list in Quick sort 28 7 39 3 63 13 61 17 50 21 Write a C function to create Heap for the given list of integers. Write a recursive function in C to search for an integer element in an array of sorted integers using binary search. Design an algorithm that will delete the entry with the largest key from the top of the heap and restore the heap properties of the resulting smaller list. Write insertion sort algorithm for sorting a given array of integers in ascending order. Write a recursive function in C to search for an integer in a given sorted array of integers using binary search. Explain the algorithm for exchange sort with a suitable example. Compare sort and exchange sort. Explain the algorithm for selection sort and give a suitable example. Write and explain linear search procedure with a suitable example. Formulate recursive algorithm for binary search with its timing analysis. Write and explain non-recursive algorithm for binary search with suitable example and discuss the various time complexities of binary search. Suppose that the list contains the integers 1,2,…8 in this order. Trace through the steps of binary search to determine what comparisons of keys are done in searching. (i) to locate 3 (ii) to locate 4.5

b) 8. 8.a) b) 8. 7.a) b) 8.a) b) 8. 8.a) b) 8.a) b)

_________________________________________________________________________

Computer Programming and Data structures

5

- DATA STRUCTURESuploaded byLokesh Arya
- DSA_First_Draftuploaded bymarcio1404
- CPuploaded byAlyssa Marie Sagaoinit
- Data Structuresuploaded bykranthi933
- Csc503 Data-structures-And-Algorithms Eth 2.00 Ac26uploaded bynetgalaxy2010
- c++ 20 Projectsuploaded byParesh Pandit
- Data Structures Objective Questions and Answers _ Set-3 _ Searchcroneuploaded bySunny Raj
- Algorithmsuploaded byPetreanu Roxana
- CS301 Midterm Papers Collection Shared by Sweet Souluploaded byAamir Amin
- A 675 Mbps, 4 4 64-Qam K-best Mimo Detector in 0.13 Cmosuploaded byTarik_Suleiman
- datastrucure-150802122219-lva1-app6891.pptxuploaded byAnonymous igVRM2mA6k
- First Termuploaded byTrynos
- lec1uploaded bySwati
- Ada Theoryuploaded byVikram Rao
- lab3-2016.pdfuploaded byAnonymous PIIgPTTU3n
- 107352_Lec06b_QuicksortV2uploaded byvignesvaran
- Data Modified- New Syllabusuploaded byjyothibellary4233
- ACh8uploaded byapi-3815042
- 4. InsertionSortuploaded bybtitty
- Sorting-Algorithm.pdfuploaded byИРадојичић
- 2012 winter a1 algorithmuploaded byapi-258458610
- Project Report Milind Gokhaleuploaded byMilind Gokhale
- Sorting Algorithmuploaded bywilliam walters
- cscuploaded byBala Kirshnan
- Data Structures and Algorithms - CodeChef Discussuploaded byKautilyaChenna
- DS - 1uploaded byvickyzik
- Dominatorsuploaded byKB
- Cuploaded bysnths
- Lecture 03[Insertion Sort]uploaded byZahraa Tishreen
- 02-FP01-4uploaded bycyrcos

- 59uploaded byvkt2006
- 61auploaded byvkt2006
- 58uploaded byvkt2006
- 60uploaded byvkt2006
- 57uploaded byvkt2006
- ECE-B II Internal Subjective marks:Mathematical Methodsuploaded byvkt2006
- 46uploaded byvkt2006
- 55uploaded byvkt2006
- IIMid QBank CDS[1]uploaded byvkt2006
- II Internal subjective marksuploaded byvkt2006

Read Free for 30 Days

Cancel anytime.

Close Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Loading