Data Structures

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Data Structures as PDF for free.

More details

  • Words: 1,441
  • Pages: 7
Set No.1

Code No: RR10203 I B.Tech.

Regular Examinations, January -2005 C & DATA STRUCTURES ( Common to Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Instrumentation & Control Engineering and Bio-Technology) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) What are constants? (b) Name the different data types that C supports & explain them in detail? 2. (a) Write a C program to do Matrix Multiplications. (b) Write in detail about one dimensional and multidimensional arrays. Also write about how initial values can be specified for each type of array? 3. (a) How are Structure elements accessed using pointer? Which operator is used? Give an example. (b) Write a program to use structure within union. Display the contents of structure elements. 4. (a) Write a ‘C’ Program to compute the sum of all elements stored in an array using pointers. (b) Write a ‘C’ program using pointers to determine the length of a character string. 5. Write a C program using pointers to implement a stack with all the operations. 6. (a) What is the difference between linked list and an array? (b) Write a ‘C’ program to reverse the elements in a singly linked list. 7. Construct a binary tree for the following preorder and inorder traversals. Explain with a neat diagram: (a) Preorder : ABDIEHJCFKLGM Inorder : DIBHJEAFLKCGM (b) Preorder: ABDEFCGHJLK Inorder : DBFEAGCLJHK 8. (a) Write and explain linear search procedure with a suitable example. (b) Formulate recursive algorithm for binary search with its timing analysis. ????? 1 of 1

Set No.2

Code No: RR10203 I B.Tech.

Regular Examinations, January -2005 C & DATA STRUCTURES ( Common to Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Instrumentation & Control Engineering and Bio-Technology) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) What is a Flowchart? Explain the different symbols used in a Flowchart? (b) Write a program to find the maximum and minimum of given numbers. 2. (a) In what way array is different from an ordinary variable? (b) What conditions must be satisfied by the entire elements of any given array? (c) What are subscripts? How are they written? What restrictions apply to the values that can be assigned to subscripts? (d) What advantage is there in defining an array size in terms of a symbolic constant rather than a fixed integer quantity? (e) Write a program to find the largest element in an array. 3. (a) How are Structure elements accessed using pointer? Which operator is used? Give an example. (b) Write a program to use structure within union. Display the contents of structure elements. 4. (a) Explain the process of accessing a variable through its pointer. Give an Example. (b) Write a C program using pointers to read in an array of integers and print its elements in reverse order. 5. Show how to implement a queue of integers in C by using an array int q[QUEUESIZE] , where q[0] is used to indicate the front of the queue , q[1] is used to indicate its rear and where q[2] through q[QUEUESIZE -1] contain elements on the queue. Show how to initialize such an array to represent the empty queue and write routines remove, insert and empty for such an implementation. 6. What is Circular doubly linked list? Explain the various operations on Circular doubly linked lists with suitable algorithms. 7. Write an algorithm for each of the following: (a) Inorder traversal 1 of 2

Set No.2

Code No: RR10203 (b) Preorder traversal (c) Postorder traversal

8. Write a C program that searches a value in a stored array using binary search. What is the time complexity of binary search? ?????

2 of 2

Set No.3

Code No: RR10203 I B.Tech.

Regular Examinations, January -2005 C & DATA STRUCTURES ( Common to Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Instrumentation & Control Engineering and Bio-Technology) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) What is the difference between break and continue statement? Explain with examples. (b) What is the purpose of go to statement? How is the associated target statement identified? (c) Write a C program to evaluate the power series E x = 1 + x + x2 + x3 + ...xn , 0 < x < 1 2. (a) In what way array is different from an ordinary variable? (b) What conditions must be satisfied by the entire elements of any given array? (c) What are subscripts? How are they written? What restrictions apply to the values that can be assigned to subscripts? (d) What advantage is there in defining an array size in terms of a symbolic constant rather than a fixed integer quantity? (e) Write a program to find the largest element in an array. 3. (a) What is the use of struct keyword? Explain the use of dot operator? Give an example for each. (b) Write a C program to accept records of the different states using array of structures. The structure should contain char state, population, literacy rate, and income. Display the state whose literacy rate is highest and whose income is highest. 4. (a) How to use pointers as arguments in a function? Explain through an example. (b) Write a ‘C’ function using pointers to exchange the values stored in two locations in the memory. 5. Write in detail about the following: (a) Recursion (b) Applications of Stacks and Queues

1 of 2

Set No.3

Code No: RR10203

6. What is singly linked list? Explain various operations on singly linked list with algorithms. 7. (a) Write a C program to implement binary tree traversals. (b) Write an algorithm to count the number of leaf nodes in a binary tree. What is its computing time? 8. Explain the algorithm for selection sort and give a suitable example. ?????

2 of 2

Set No.4

Code No: RR10203 I B.Tech.

Regular Examinations, January -2005 C & DATA STRUCTURES ( Common to Electrical & Electronic Engineering, Electronics & Communication Engineering, Computer Science & Engineering, Electronics & Instrumentation Engineering, Bio-Medical Engineering, Information Technology, Electronics & Control Engineering, Computer Science & Systems Engineering, Electronics & Telematics, Electronics & Computer Engineering, Instrumentation & Control Engineering and Bio-Technology) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Write the various steps involved in executing a C program and illustrate it with a help of flowchart. (b) Candidates have to score 90 or above in the IQ test to be considered eligible for taking further tests. All candidates who do not clear the IQ test are sent reject letters and others are sent call letters for further tests. Represent the logic for automating this task. 2. (a) Distinguish between getchar and scanf functions for reading strings. (b) Write a program to count the number of words, lines and characters in a text. 3. (a) How are Structure elements accessed using pointer? Which operator is used? Give an example. (b) Write a program to use structure within union. Display the contents of structure elements. 4. (a) Distinguish between the following functions. i. Printf and fprintf. ii. eof and ferror. (b) Write a program to copy the contents of one file into another. 5. Use the operations push, pop, stacktop, and empty to construct operations on stack, which do each of the following: Given an integer n, set i to the n the element from the top of stack, leaving the stack unchanged Set I to the bottom element of stack, leaving the stack empty. 6. Write a C program to create a singly linked list and split it at the middle and make the second half as the first and vice-versa. Display the final list. 7. Write an algorithm, given the address of an input binary tree, prints the equivalent infix expression with minimum number of paranthesis. 8. Discuss in detail about the following searching methods. (a) Sequential search 1 of 2

Set No.4

Code No: RR10203 (b) Fibonacci search ?????

2 of 2

Related Documents

Data Structures
October 2019 38
Data Structures
June 2020 21
Data Structures
April 2020 34
Data Structures
May 2020 22
Data Structures
November 2019 40
Data Structures
November 2019 36