9 views

Uploaded by Kumar Puspesh

- 25 Slide
- 8th Chapter-queues and Linked Lists
- mcaschsyll2013
- Lab Manual1
- Previous Papers 2011
- BCA Part-I(Semester I & II) (1)
- Data Structures Lab Manual
- Double Linked List
- DATA STRUCT 2003
- Lab Manual DS and OOPS
- 2130702
- dsquestions
- Commonly Asked Data Structure Interview Questions.docx
- TCS Type 3 Facts & Concepts...
- Technical Aptitude Questions eBook
- hw03-solution.pdf
- DS3
- Introduction to Computer Science II
- Wipro -Technical Aptitude Questions-T&P Cell MMMEC- eBook
- 2010 -S1

You are on page 1of 6

1)Consider the following structure struct node { int info; struct node *link; }; Suppose ptr is a pointer which is not pointing to the first or the last node. Then if we are going to delete a node after ptr, then the code will be a) ptr=ptr->link; b) ptr->link=ptr; c) ptr->link=ptr->link->link; d) ptr=ptr->link->link;

2) Consider the following structure struct node { int info; struct node *link; }; Suppose start is a pointer pointing to the first node of the linked list. s1 and ptr are the two pointers (they are not pointing to the first or last node). Then if we are going to execute the following code, i) start->link=s1; ii) s1->link=ptr; iii) ptr->link=start; then the list is a) It is having only 3 nodes with start, s1, ptr in the list, having start as the first node b) It is a circular linked list c) It is a doubly linked list d) None of the above

3) In a queue, if rear=front then what will be the queue a) Queue is empty b) Queue is full c) Queue has only one element d) None of the above 4) In a queue, if rear=0, front=0 then what will be the queue a) Queue is empty b) Queue is full c) Queue has only one element d) None of the above 5) a) b) c) d) In a queue, if rear=0, front=1 then what will be the queue Queue is empty Queue is full Queue has only one element Queue is circular

6) In a queue,if rear=-1,front=-1 then what will be the queue a) Queue is empty b) Queue is full c) Queue has only one element d) None of the above 7) In a queue, if rear=max-1, front=0 then what will be the queue a) Queue is empty b) Queue is full c) Queue has only one element d) None of the above 8) The postfix expression is ab+c*d/e-.The values of a, b, c, d, e are 2, 4, 5, 2, 1 respectively. Then the output is a) b) c) d) 14 11 20 15

9) The infix expression is a+b*(c-d)/(e+f)*h then my postfix expression is a) ab+cd-*ef+h*/ b) abcd-ef+*/h* c) abcd-*ef+/h*+ d) abcdef+-*/h*+ 10) In the stack, if top=0 then the stack is a) Stack is empty b) Stack is full c) Stack has only one element d) None of the above

11) Consider the structure struct node { int info; struct node *left; struct node *right; }; We have 10 elements in the list. If the following executes what will be the output? for(ptr=start; ptr; ptr=ptr->right) { if(ptr->data%2==0) printf("%d", ptr->data); } a) Only even numbers are printed b) Only odd numbers are printed c) Compiler error d) Only garbage values 12) struct node { int data; struct node *left,*right; };

Suppose nd is a node which is not in the beginning and also not in the end. How will you delete a node after nd? a) nd->right=nd->right->left;nd->right->left=nd->left->right; b) nd->right=nd->right->right;nd->right->left=nd; c) nd->right=nd->right->left;nd->right->left=nd->right; d) nd->right=nd->left->right;nd->left->right=nd;

13)

Suppose nd is a node which is not in the beginning and also not in the end. How will you delete a node before nd? a) nd->left=nd->right->left;nd->right->left=nd->left->right; b) nd->left=nd->right->right;nd->left->right=nd->right; c) nd->left=nd->left->left;nd->left->right=nd; d) nd->left=nd->left->right;nd->left->right=nd; 14) struct node { int data; struct node *left,*right; };

Suppose ptr is a node which is not in the beginning and also not in the end. How will you delete a node ptr? a) ptr->left->right=ptr->right;ptr->right->left=ptr->left;free(ptr); b) ptr->left->right=ptr->right->right;ptr->left->right=ptr->right;free(ptr); c) ptr->left->right=ptr->left->left;ptr->left->right=ptr;free(ptr); d) ptr->left->right=ptr->left;ptr->left->right=ptr->left;free(ptr);

15)

Suppose ptr is a node which is not in the beginning and also not in the end. nd is the new node. Here is the coding: i) ptr->right->left=nd; ii) nd->left=ptr; iii) ptr->right=nd; iv) nd->right=ptr->right; Then what sequence does it follows for inserting nd after ptr? a) i,ii,iii,iv b) ii,iv,i,iii c)iv,iii,ii,i d) ii,iii,i,iv 16) In the Given Infix expression which is the root node for your expression tree (A+B)-(C*D)+G/H*I a) + b) c) * d) /

17) Consider a binary search tree insert(10,root); insert(25,root); insert(5,root); insert(8,root); insert(13,root); insert(45,root); insert(70,root); insert(32,root); delete(13,root);

insert(66,root); insert(13,root); insert(36,root); What will be the preorder traversal is a) 5,8,10,13,25,32,36,45,66,70 b) 10,5,8,25,13,45,32,36,70,66 c) 10,8,5,13,32,45,36,66,32,70 d) 8,5,32,36,10,66,45,70,25,13

19) The preorder traversal is 5, 3, 66, 30, 77, 70 .What will be the root node a) 5 b) 66 c) 70 d) 30 20) Which one of the following is true for the binary tree i) root is greater than the left sub tree and lesser than the right sub tree ii) root is lesser than the left sub tree and greater than the right sub tree a) only i b) only ii c) both i and ii d) Neither i nor ii

- 25 SlideUploaded byMasinde Andrew
- 8th Chapter-queues and Linked ListsUploaded byAditya Nath
- mcaschsyll2013Uploaded byapi-258496630
- Lab Manual1Uploaded byRadha Thiruppathi
- Previous Papers 2011Uploaded byKishore Kick
- BCA Part-I(Semester I & II) (1)Uploaded byMrinal Sharma
- Data Structures Lab ManualUploaded bynaquash1983
- Double Linked ListUploaded bySanchit Rk
- DATA STRUCT 2003Uploaded byapi-3782519
- Lab Manual DS and OOPSUploaded bysswarub
- 2130702Uploaded byAmit Rathod
- dsquestionsUploaded bysankar_mca227390
- Commonly Asked Data Structure Interview Questions.docxUploaded byvmkakumanu
- TCS Type 3 Facts & Concepts...Uploaded byDeathly Hallow
- Technical Aptitude Questions eBookUploaded byArunkumar
- hw03-solution.pdfUploaded bysiddharth1k
- DS3Uploaded bysatya20000
- Introduction to Computer Science IIUploaded byAnik
- Wipro -Technical Aptitude Questions-T&P Cell MMMEC- eBookUploaded byarpan19989
- 2010 -S1Uploaded bymaster_proyo
- jds4Uploaded byThiyagarajah Ragunathan
- Hospital QueryUploaded byharvinder thukral
- Technical Aptitude Questions eBookUploaded byPiyush Garg
- Kjsce_se Comp Kjsce Syllabus(15-16) Updated on Mar 23, 2016Uploaded byINDIAN SQUATCHER
- AptitudeUploaded byPrashant Sajeendran
- CONCEPTS(very imp)Uploaded byarjun4084346
- data structure bookUploaded byShivam Singhal
- CONCEPTS(very imp).DOCUploaded byKumar Gaurav
- Set Data Structure-2Uploaded byTech_MX
- Technical Aptitude QuestionsUploaded byKiran K Knr

- all-b94372848c58a756aacca5c66c4f6cd95822d02da2ead19eebcf5376ed6443bb.jsUploaded byalma
- EC6301 Object Oriented Programming and Data Structures v6Uploaded byappasami
- QSM PC Arch -Full PaperUploaded byHeru Setiawan
- CSE-III-DATA STRUCTURES WITH C [10CS35]-NOTES.pdfUploaded byAbhishek Sharma
- BFS CorrectnessUploaded byandrey_dung
- How to Read SMS From Specific Number and Delete From Inbox Programmatically - CoderjunkUploaded byVairamoorthy Arunachalam
- Data StructuresUploaded byMcaif
- Ex FinalUploaded bySiti Hasliana
- A7670 Alarm DictionaryUploaded bynghiatt
- Homework Q QuestionUploaded byyahz
- Spi Vip User ManualUploaded byYeshoda Mallikarjuna
- Introduction to Computer Science Tác giả: Trần Đức Quang Đại học Văn Lang, 2008Uploaded byDạy Kèm Quy Nhơn Official
- Useful C ProgramsUploaded byrsgk
- INTRODUCTION TO BASIC DATA STRUCTURESUploaded byvenkatesh
- Linux601-700Uploaded bysuresh
- 2006_C++_DelhiUploaded byGirish Raguvir
- chapter4...5...6...7Uploaded bytbijle
- DSA Lab Manual FinalUploaded byIrfan Khan
- 1. ObamiroUploaded byLucya Bertha
- MCA programming and c++ noteUploaded byAmit Jaju
- Stacks and QueuesUploaded byGobara Dhan
- Question Bank - i to v- Part a and Part B-1Uploaded byJose Clark
- bbischUploaded byjayanthbumaiyya
- Ds&Oops Lab Manual-eceUploaded byHari Krishnan
- Computer Organization Hamacher Instructor Manual Solution - Chapter 2Uploaded byNovandi Banitama
- Lecture 1IntroUploaded byAli Virk
- vit university syallabusUploaded bypranavateja12399
- IE_403_LAB_1Uploaded byAldo Ruiz
- Java Programming Lab Programs ListUploaded byPalakonda Srikanth
- IBPS IT Officer Exam Capsule Part 2.pdfUploaded bySreeLatha