EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

Similar documents
DATA STRUCUTRES. A data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

DEEPIKA KAMBOJ UNIT 2. What is Stack?

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

1 P age DS & OOPS / UNIT II

Lists, Stacks, and Queues. (Lists, Stacks, and Queues ) Data Structures and Programming Spring / 50

DATA STRUCTURE UNIT I

17CS33:Data Structures Using C QUESTION BANK

CSE 230 Intermediate Programming in C and C++

infix expressions (review)

12 Abstract Data Types

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows:

INSTITUTE OF AERONAUTICAL ENGINEERING

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- MARCH, 2012 DATA STRUCTURE (Common to CT and IF) [Time: 3 hours

Stack Applications. Lecture 27 Sections Robb T. Koether. Hampden-Sydney College. Wed, Mar 29, 2017

PA3 Design Specification

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Stack Abstract Data Type

Introduction. Problem Solving on Computer. Data Structures (collection of data and relationships) Algorithms

CS 206 Introduction to Computer Science II

STACKS AND QUEUES. Problem Solving with Computers-II


Prepared By: Ms. Nidhi Solanki (Assist. Prof.) Page 1

R10 SET - 1. Code No: R II B. Tech I Semester, Supplementary Examinations, May

CS 206 Introduction to Computer Science II

Postfix (and prefix) notation

Linked List. April 2, 2007 Programming and Data Structure 1

Data Structure using C++ Lecture 04. Data Structures and algorithm analysis in C++ Chapter , 3.2, 3.2.1

MID TERM MEGA FILE SOLVED BY VU HELPER Which one of the following statement is NOT correct.

LIFO : Last In First Out

First Semester - Question Bank Department of Computer Science Advanced Data Structures and Algorithms...

Data Structures. Chapter 06. 3/10/2016 Md. Golam Moazzam, Dept. of CSE, JU

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

Stacks. Chapter 5. Copyright 2012 by Pearson Education, Inc. All rights reserved

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Solution: The examples of stack application are reverse a string, post fix evaluation, infix to postfix conversion.

Introduction p. 1 Pseudocode p. 2 Algorithm Header p. 2 Purpose, Conditions, and Return p. 3 Statement Numbers p. 4 Variables p. 4 Algorithm Analysis

Lecture Data Structure Stack

Department of Computer Science and Technology

Insert. SEMCOM Page 1 of 11

FORTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLIGY- OCTOBER, 2012 DATA STRUCTURE

PESIT Bangalore South Campus Department of MCA Course Information for

Objective Questions for Online Practical Exams under CBCS Scheme Subject: Data Structure-I (CS-113)

Some Applications of Stack. Spring Semester 2007 Programming and Data Structure 1

Stacks. stacks of dishes or trays in a cafeteria. Last In First Out discipline (LIFO)

Content: Learning Objectives

VALLIAMMAI ENGINEERING COLLEGE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING B.E SECOND SEMESTER CS 6202 PROGRAMMING AND DATA STRUCTURES I TWO MARKS UNIT I- 2 MARKS

CS W3134: Data Structures in Java

Arrays and Linked Lists

ASSIGNMENTS. Progra m Outcom e. Chapter Q. No. Outcom e (CO) I 1 If f(n) = Θ(g(n)) and g(n)= Θ(h(n)), then proof that h(n) = Θ(f(n))

Data Structures. Outline. Introduction Linked Lists Stacks Queues Trees Deitel & Associates, Inc. All rights reserved.

March 13/2003 Jayakanth Srinivasan,


DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

Stack Applications. Lecture 25 Sections Robb T. Koether. Hampden-Sydney College. Mon, Mar 30, 2015

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

Stacks, Queues and Hierarchical Collections

Data Structures Question Bank Multiple Choice

Prepared by Mrs.D.Maladhy (AP/IT/RGCET) Page 1

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 154) Pass Marks: 24

Information Science 2

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

CS301 - Data Structures Glossary By

Reg. No. : Question Paper Code : 27157

Data Structures. 1. Each entry in a linked list is a called a (a)link (b)node (c)data structure (d)none of the above

List, Stack, and Queues

Stack and Its Implementation

Lecture No.04. Data Structures

An Introduction to Trees

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

Sample Question Paper

Types of Data Structures

Bharati Vidyapeeth s College Of Engineering for Women Pune-43 Department E & TC. SE- Unit Test I Subject-DS

Linear Data Structure

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC First Semester CSE/IT DATA STRUCTURES USING C

ADVANCED DATA STRUCTURES USING C++ ( MT-CSE-110 )

Dynamic Data Structures

VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur

09 STACK APPLICATION DATA STRUCTURES AND ALGORITHMS REVERSE POLISH NOTATION

A Programming Approach with C DHARMENDER SINGH KUSHWAHA

The Bucharest University of Economic Studies. Data Structures. ADTs-Abstract Data Types Stacks and Queues

CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING EC6301 OBJECT ORIENTED PROGRAMMING AND DATA STRUCTURES

Ashish Gupta, Data JUET, Guna

DATA STRUCTURES AND ALGORITHMS

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Lecture 12 ADTs and Stacks

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

1. Attempt any three of the following: 15

Top of the Stack. Stack ADT

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

Stacks and their Applications

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Formal Languages and Automata Theory, SS Project (due Week 14)

Introduction to Data Structure

Lecture 4 Stack and Queue

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

Transcription:

UNIT 3 LINEAR DATA STRUCTURES 1. Define Data Structures Data Structures is defined as the way of organizing all data items that consider not only the elements stored but also stores the relationship between the elements. 2. Define Linked Lists Linked list consists of a series of structures, which are not necessarily adjacent in memory. Each structure contains the element and a pointer to a structure containing its successor. We call this thenext Pointer. The last cell snext pointer points to NULL. 3. State the different types of linked lists The different types of linked list include singly linked list, doubly linked list and circular linked list. 4. List the basic operations carried out in a linked list The basic operations carried out in a linked list include: Creation of a list Insertion of a node Deletion of a node Modification of a node Traversal of the list 5. List out the advantages of using a linked list It is not necessary to specify the number of elements in a linked list during its declaration Linked list can grow and shrink in size depending upon the insertion and deletion that occurs in the list Insertions and deletions at any place in a list can be handled easily and efficiently A linked list does not waste any memory space 6. List out the disadvantages of using a linked list Searching a particular element in a list is difficult and time consuming A linked list will use more storage space than an array to store the same number of elements 7. List out the applications of a linked list Some of the important applications of linked lists are manipulation of polynomials, sparse matrices, stacks and queues.

8. State the difference between arrays and linked lists Arrays Size of an array is fixed It is necessary to specify the number of elements during declaration. Insertions and deletions are somewhat difficult It occupies less memory than a linked list for the same number of elements Linked Lists Size of a list is variable It is not necessary to specify the number of elements during declaration Insertions and deletions are carried out easily It occupies more memory 9. Define a stack Stack is an ordered collection of elements in which insertions and deletions are restricted to one end. The end from which elements are added and/or removed is referred to as top of the stack. Stacks are also referred as piles, push-down lists and last-in-firstout (LIFO) lists. 10. List out the basic operations that can be performed on a stack The basic operations that can be performed on a stack are Push operation Pop operation Peek operation Empty check Fully occupied check 11. State the different ways of representing expressions The different ways of representing expressions are Infix Notation Prefix Notation Postfix Notation 12. State the rules to be followed during infix to postfix conversions Fully parenthesize the expression starting from left to right. During parenthesizing, the operators having higher precedence are first parenthesized Move the operators one by one to their right, such that each operator replaces their corresponding right parenthesis The part of the expression, which has been converted into postfix is to be treated as single operand 13. State the difference between stacks and linked lists The difference between stacks and linked lists is that insertions and deletions may occur anywhere in a linked list, but only at the top of the stack

14. Mention the advantages of representing stacks using linked lists than arrays It is not necessary to specify the number of elements to be stored in a stack during its declaration, since memory is allocated dynamically at run time when an element is added to the stack Insertions and deletions can be handled easily and efficiently Linked list representation of stacks can grow and shrink in size without wasting memory space, depending upon the insertion and deletion that occurs in the list Multiple stacks can be represented efficiently using a chain for each stack 15. Define a queue Queue is an ordered collection of elements in which insertions are restricted to one end called the rear end and deletions are restricted to other end called the front end. Queues are also referred as First-In-First-Out (FIFO) Lists. 16. Define a priority queue Priority queue is a collection of elements, each containing a key referred as the priority for that element. Elements can be inserted in any order (i.e., of alternating priority), but are arranged in order of their priority value in the queue. The elements are deleted from the queue in the order of their priority (i.e., the elements with the highest priority is deleted first). The elements with the same priority are given equal importance and processed accordingly. 17. State the difference between queues and linked lists The difference between queues and linked lists is that insertions and deletions may occur anywhere in the linked list, but in queues insertions can be made only in the rear end and deletions can be made only in the front end. 18. Define a Deque Deque (Double-Ended Queue) is another form of a queue in which insertions and deletions are made at both the front and rear ends of the queue. There are two variations of a deque, namely, input restricted deque and output restricted deque. The input restricted deque allows insertion at one end (it can be either front or rear) only. The output restricted deque allows deletion at one end (it can be either front or rear) only. 19. Define an Abstract Data Type (ADT) An abstract data type is a set of operations. ADTs are mathematical abstractions; nowhere in an ADT s definition is there any mention of how the set of operations is implemented. Objects such as lists, sets and graphs, along with their operations can be viewed as abstract data types. 20. What are the advantages of modularity? It is much easier to debug small routines than large routines It is easier for several people to work on a modular program simultaneously A well-written modular program places certain dependencies in only one routine, making changes easier

Sri vidya college of engineering and technology Question bank 21. What are the objectives of studying data structures? To identify and create useful mathematical entities and operations to determine what classes of problems can be solved using these entities and operations To determine the representation of these abstract entities and to implement the abstract operations on these concrete representation 22. What are the types of queues? Linear Queues The queue has two ends, the front end and the rear end. The rear end is where we insert elements and front end is where we delete elements. We can traverse in a linear queue in only one direction ie) from front to rear. Circular Queues Another form of linear queue in which the last position is connected to the first position of the list. The circular queue is similar to linear queue has two ends, the front end and the rear end. The rear end is where we insert elements and front end is where we delete elements. We can traverse in a circular queue in only one direction ie) from front to rear. Double-Ended-Queue Another form of queue in which insertions and deletions are made at both the front and rear ends of the queue. 23. List the applications of stacks Towers of Hanoi Reversing a string Balanced parenthesis Recursion using stack Evaluation of arithmetic expressions 24. List the applications of queues Jobs submitted to printer Real life line Calls to large companies Access to limited resources in Universities Accessing files from file server 25. Why we need cursor implementation of linked lists? Many languages such as BASIC and FORTRAN do not support pointers. If linked lists are required and pointers are not available, then an alternative implementation must be used known as cursor implementation. PART B PART B 1. What are the various linked list operations? Explain. 2. Explain about array based implementations. 3. Write routines to implement addition of two polynomials. 4. Write the insertion and deletion routine for doubly linked list.

Sri vidya college of engineering and technology Question bank 5. Write the operations performed on singly linked list. 6. Write the operations performed in circularly linked list. 7. What is stack ADT?. Explain how it can be implemented using arrays. 8. Write ADT operations for array implementation of a queue. 9. Write the algorithm for converting infix expression to postfix expression?. 10. Explain any two applications of stack. 11. Explain about push operations and Write the routine for push operation on stack. 12. Explain any two applications of queue with an example program. 13. Explain about the circular queue with an example. 14. Explain how the given expression is converted into postfix expression using stack. A+((B*D+E/F)^G-H)/C+E*F)-B*E 15. Write ADT operations for array implementation of queue. 16. Explain the process of postfix expression evaluation with an example.