Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G1)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
S. No. Marks
1. Consider the following infix expression:- [2]
P: (L+J-U)/(E-F)+K
Write the procedure and convert into the equivalent postfix expression.
2. Write and explain the algorithm for insertion of a node between two adjacent [2]
nodes A and B of a singly linked list.
3. Given an empty queue Q, what does it look like after the following operations? [2]
[Link](78)
[Link](28)
[Link]()
[Link](56)
[Link]()
4. What is the output of following function for start pointing to first node of [2]
following linked list? 1->2->3->4->5->6
void fun(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start->data);
if(start->next != NULL )
fun(start->next->next);
printf("%d ", start->data);
}
Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G2)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
S. No. Marks
1. Consider the postfix expression P: 12, 7, 3, -, /, 2, 1, 5, +, *, + [2]
First add a sentinel right parenthesis at the end of P to obtain
P: 12, 7, 3, -, /, 2, 1, 5, +, *, +, )
2. Consider the following in fix expression [2]
P: ((A + B)*B)↑(E-F))
Write the procedure and convert into post-fix expression.
3. Difference between header linked list and doubly linked list. [2]
4. Write an algorithm for quick sort and also analyze its complexity. [2]
Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G3)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
S. No. Marks
1. Discus whether a stack or queue is appropriate structure when a batch of [2]
computer programs are submitted to a computer.
2. Write a program to represent a queue with the help of An Array. [2]
3. User perform following operations on stack of size 5 then - [2]
push(1);
pop();
push(2);
push(3);
pop();
push(4);
pop();
pop();
push(5);
at the end of last operation, total number of elements present in the stack are.
4. Consider the following infix expression:- [2]
P: (A+B*D)/(E-F)+G
Write the procedure and convert into the equivalent postfix expression.
Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G4)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
Marks
S. No.
1. Post fix form of following infix expression is - [2]
(A + B) * (C + D - E) * F
2. Explain recursion with example. How is it different from iteration? Write a [2]
procedure to generate Fibonacci series using recursive function.
3. Write an algorithm to check the underflow and overflow condition in a stack. [2]
4. Given an efficient circular array-based queue Q capable of holding 10 objects. [2]
Show the final contents of the array after the following code is executed:
for (int k = 1; k ≤ 7; k++)
[Link](k);
for (int k = 1; k ≤ 7; k++)
[Link]([Link]());
Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G5)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
Marks
S. No.
1. Sort the given input data in ascending order using Quick Sort algorithm: 10 ,62, 20, [2]
6,72,5,89,2 .
2. Write an algorithm to check the underflow and overflow condition in a Queue. [2]
3. Write program to find a factorial of a number using recursive function. [2]
4. Can we apply binary search algorithm on link-list? Write your answer with [2]
explanation.
Chandigarh University
Department of Electronics & Communication Engineering
Assignment # 02(G6)
Programme: BE Semester: 4th
Subject Name: Data Structures Subject Code: ECT-255
Date of Allocation: 20-Feb-18 Date of Submission: 19-Mar-18
Max. Marks: 08
Marks
S. No.
1. [2]
Convert the expression (M-N)/ R into postfix and show the contents of stack.
2. Write an algorithm to check the underflow and overflow condition in a Queue. [2]
3. Sort the given input data in ascending order using Quick Sort algorithm: [2]
16,180,30,9,56,5,74.
4. Write an algorithm of Traversing a circular linked list with example. [2]