DATA STRUCTURE UNIT I

Similar documents
CS DATA STRUCTURES AND ALGORITHMS

DATA STRUCTURES AND ALGORITHMS

EC8393FUNDAMENTALS OF DATA STRUCTURES IN C Unit 3

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

1 P age DS & OOPS / UNIT II

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

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

17CS33:Data Structures Using C QUESTION BANK

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

CS8391-DATA STRUCTURES

CS 8391 DATA STRUCTURES

Sample Question Paper

12 Abstract Data Types

DATA STRUCTURES AND ALGORITHMS UNIT I LINEAR STRUCTURES

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

DEEPIKA KAMBOJ UNIT 2. What is Stack?

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

Revision Statement while return growth rate asymptotic notation complexity Compare algorithms Linear search Binary search Preconditions: sorted,

CS 206 Introduction to Computer Science II

Fundamentals of Data Structure

CS 206 Introduction to Computer Science II

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

Department of Computer Science and Technology

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

STACKS AND QUEUES. Problem Solving with Computers-II

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

Outline. Introduction Stack Operations Stack Implementation Implementation of Push and Pop operations Applications. ADT for stacks

ADT: Lists, Stacks and Queues

Stacks, Queues and Hierarchical Collections

PESIT Bangalore South Campus Department of MCA Course Information for

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

Lecture No.04. Data Structures

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

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

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

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

CS301 - Data Structures Glossary By

Stacks, Queues and Hierarchical Collections. 2501ICT Logan

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

8. Fundamental Data Structures

Postfix (and prefix) notation

Programming and Data Structure Solved. MCQs- Part 2

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

CS200: Queues. Prichard Ch. 8. CS200 - Queues 1

Linear Structures. Linear Structure. Implementations. Array details. List details. Operations 4/18/2013

Lecture Data Structure Stack

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

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

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

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

Linear Structures. Linear Structure. Implementations. Array details. List details. Operations 2/10/2013

Answers. 1. (A) Attempt any five : 20 Marks

PA3 Design Specification

Data Structure - Stack and Queue-

List, Stack, and Queues

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

Content: Learning Objectives

DYNAMIC MEMORY ALLOCATION AND DEALLOCATION

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

INSTITUTE OF AERONAUTICAL ENGINEERING

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

3. Fundamental Data Structures

Where does the insert method place the new entry in the array? Assume array indexing starts from 0(zero).

Data Structures Question Bank Multiple Choice

VALLIAMMAI ENGINEERING COLLEGE

Queues. Lesson 4. CS 32: Data Structures Dept. of Computer Science

DHANALAKSHMI COLLEGE OF ENGINEERING Tambaram, Chennai

Programming. Lists, Stacks, Queues

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

EEE2020 Data Structures and Algorithms Abstract Data Types: Stacks and Queues

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

Ashish Gupta, Data JUET, Guna

CMSC Introduction to Algorithms Spring 2012 Lecture 7

S.SAKTHI, LECTURER/IT

Types of Data Structures

.:: UNIT 4 ::. STACK AND QUEUE

S.Y. B.Sc. (IT) : Sem. III. Data Structures

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

Adapted By Manik Hosen

Week 6. Data structures


Cpt S 122 Data Structures. Course Review Midterm Exam # 1

SCHOOL OF COMPUTER AND COMMUNICATION ENGINEERING. EKT224: ALGORITHM AND DATA STRUCTURES (Stack, Queue, Linked list)

MAHARASHTRASTATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Lists, Stacks and Queues in C. CHAN Hou Pong, Ken CSCI2100A Data Structures Tutorial 4

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

Data Structure. IBPS SO (IT- Officer) Exam 2017

Infix to Postfix Conversion

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

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

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

MIDTERM EXAMINATION Spring 2010 CS301- Data Structures

An Introduction to Trees

Abstract Data Types 1

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

Stacks and Queues. CSE Data Structures April 12, 2002

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

Transcription:

DATA STRUCTURE UNIT I 1. What is Data Structure? A data structure is a mathematical or logical way of organizing data in the memory that consider not only the items stored but also the relationship to each other and also it is characterized by accessing functions. 2. List down any four applications of data structures? a. Compiler design b. Operating System c. Database Management system d. Network analysis 3. What is Linear data structure? A collection of data set stored in a sequence order into memory is known as linier data structure. A sequence of zero or more elementsa1, A2, A3, AN N: length of the list A1: first element AN: last element Ai: position i If N=0, then empty list Linearly ordered Ai precedes Ai+1 Ai follows Ai-1 4. Give examples of linear and non-linear data structure? Linier data structure: Lists, Stacks, Queues Non-linier data structure Trees, Graphs, Sets, Tables 5. What is ADT? An ADT is a set of operation. A useful tool for specifying the logical properties of a data type is the abstract data type.adt refers to the basic mathematical concept that defines the data type. Eg.Objects such as list, set and graph along their operations can be viewed as ADT's. Union, Intersection, size, complement and find are the various operations of ADT. 6. Define Algorithm. Algorithm is a solution to a problem independent of programming language. It consist of set of finite steps which, when carried out for a given set of inputs, produce the corresponding output and terminate in a finite time.

7. What are the features of an efficient algorithm? a. Free of ambiguity b. Efficient in execution time c. Concise and compact d. Completeness e. Definiteness f. Finiteness 8. What is List ADT? List ADT is a sequential storage structure. General list of the form a1, a2, a3.., an and the size of the list is 'n'. Any element in the list at the position I is defined to be ai, ai+1 the successor of ai and ai-1is the predecessor of ai. 9. What are the different ways to implement list? a. Simple array implementation of list b. Linked list implementation of list 10. What are the advantages in the array implementation of list? a. Print list operation can be carried out at the linear time b. Find Kth operation takes a constant time 11. What are the various operations done under list ADT? a. Print list b. Insert c. Make empty d. Remove e. Next f. Previous g. Find kth element 12. What is Linked List? Linked list is a kind of series of data structures, which are not necessarily adjacent in memory. Each structure contains the element and a pointer to a record containing its successor. 13. Name the two fields of Linked list? a. Info field(data part) b. Next field(address part) 14. What is Doubly Linked List? In a simple linked list, there will be one pointer named as 'NEXT POINTER' to point the next element, where as in a doubly linked list, there will be two pointers one to point the next element and the other to point the previous element location.

15. Name the three fields of Doubly Linked list? Info field Left field Right field 16. What is Circular Linked List? When the last node or pointer of a list, point to the first element of the list, then it is a circularly linked list. 17. What is Sentinel / Dummy node / Header Node? The first node of the list may be created with no information to indicate the starting place of the list, which is known as dummy or sentinel or header node. 18. Define Structure? A Structure is a group of items in which each item is identified by its own identifier,each of which is known as a member of the structure. 19. What are the applications of linked list? 1. Polynomial Addition 2. Radix Sort 3. Multi list 4. Buddy system 5. Dynamic memory allocation 6. Garbage Collection 20. What is Radix Sort? Radix sort is one of the linear sorting algorithms for integers. It functions by sorting the input numbers on each digit, for each of the digits in the numbers. However, the process adopted by this sort method is somewhat counterintuitive, in the sense that the numbers are sorted on the least-significant digit first, followed by the second-least significant digit and so on till the most significant digit. 21. What is garbage collection? In computer science, garbage collection (GC) is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory used by objects that are no longer in use by the application. 22. What is Stack ADT? A Stack is an ordered collection of items into which new items may be inserted and from which items may be deleted at one end, called the top of the stack. The other name of stack is Last-in -First-out list. ADT operations of Stack: 1. PUSH 2. POP

23. What are the applications of Stack ADT? 1. Conversion of infix to postfix 2. Evaluation of expression 3. Function calls / recursive calls 4. Balancing symbols 5. Conversion of numbers 24. What is Queue ADT? Queue is another data structure which has two ends, front and rear, where data is added only at the rear and is removed only at the front. Thus the first item to be inserted is always the first to be removed (FIFO) Applications of Queue ADT:, Access to network resources such as printing, mail-server, web-server, etc are mostly based on FCFS. ADT operations: CreateQueue, ClearQueue, FullQueue, EmptyQueue, AppendQueue (enqueue) and Serve (dequeue or remove). Way of Implementation: It can also be implemented using both array (static approach)and linked list (Dynamic approach). 25. What is Circular Queue? The queue, which wraps around upon reaching the end of the array is called as circular queue. 26. Explain the usage of stack in recursive algorithm implementation? In recursive algorithms, stack data structures is used to store the return address when a recursive call is encountered and also to store the values of all the parameters essential to the current state of the procedure. Priority queue is a data structure in which the intrinsic ordering of the elements does determine the results of its basic operations. Ascending and Descending priority queue are the two types of Priority queue. 27. What is LIFO? Name the ADT which one uses LIFO operation. LIFO - Last In First Out. Stack ADT uses LIFO operation.

28. What is FIFO? Name the ADT which one uses FIFO operation. FIFO First In First Out. Queue uses the FIFO operation. 29. Write algorithm for inserting a node at the beginning of the list ADT. If(start == NULL) { Start = newnode(); } Else { Newnode->next = start; Start = newnode; } 30. Define Recursion? Recursion is a function calling itself again and again. 31. Write postfix from of the expression A+B-C+D? A-B+C-D+ 32. What are the postfix and prefix forms of the expression? A+B*(C-D)/(P-R) Postfix form: ABCD-*PR-/+ Prefix form : +A/*B-CD-PR 33. What are the postfix and prefix forms of the expression? A+B*(C-D)/(P-R) Postfix form: ABCD-*PR-/+ Prefix form: +A/*B-CD-PR 34. How do you test for an empty queue? To test for an empty queue, we have to check whether READ=HEAD where REAR is a pointer pointing to the last node in a queue and HEAD is a pointer that pointer to the dummy header. In the case of array implementation of queue, the condition to be checked for an empty queue is READ<FRONT.