8 views

Uploaded by arunascarlet

data structure

- Types and Opetopes
- PS_Basic
- Questions Chapter Wise
- Data Structures
- Multicast Routing 2
- Relay Sched
- The Introduction of Several GUI Structural Metrics to Make Test Automation More Effective
- Tree Topology
- 06 BehaviorTrees
- A Study of Content Extraction From Web Pages Based on Links
- Greedy_Algorithms.pdf
- BSC Multimedia.pdf
- Doctrine Orm for Php
- 7-Minimum-Spanning-Tree.pdf
- Segment Tree
- Ec6301 Oop&Ds Notes
- Elementary Data Structures - Stacks, Queues, & Lists, Amortized analysis Trees.ppt
- spr2
- Lesson 1 Notes
- Assignment

You are on page 1of 9

Data Structure

1. What is data structure? A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data. 2. List out the areas in which data structures are applied extensively? Compiler Design, Operating System, Database anagement System, Statistical analysis package, !umerical Analysis, "raphics, Artificial #ntelligence, Simulation !"#$%

3. What are the major data structures used in the following areas : &etwor' data model ( )ierarchical data model. $D% S & Array 'i.e. Array of structures( !etwork data model & "raph )ierarchical data model & *rees

*. +f you are using , language to implement the heterogeneous lin'ed list% what pointer type will you use? *he heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. #t is not possible to use ordinary pointers for this. So we go for void pointer. +oid pointer is capable of storing pointer to any type as it is a generic pointer type. -. #inimum num.er of /ueues needed to implement the priority /ueue? *wo. One ,ueue is used for actual storing of data and another for storing priorities. 0. What is the data structures used to perform recursion? Stack. %ecause of its -#.O '-ast #n .irst Out( property it remembers its /caller0 so knows whom to return when the function has to return. $ecursion makes use of system stack for storing the return addresses of the function calls. 1very recursive function has its e/uivalent iterative 2non3recursive4 function. 1ven when such e,uivalent iterative procedures are written, e2plicit stack is to be used.

Visit www.aucse.com A website on big ideas! 5. What are the notations used in 1valuation of 6rithmetic 1xpressions using prefix and postfix forms? 4olish and $everse 4olish notations. 7. ,onvert the expression 226 8 "4 9 , : 2! : 14 ; 2< 8 =44 to e/uivalent >refix and >ostfix notations. 4refi2 !otation5 6 7 8 9A%C 7 D1 9 ." 4ostfi2 !otation5 A% 9 C 8 D1 7 7 ." 9 6 ?. $orting is not possi.le .y using which of the following methods? 2a4 +nsertion 2.4 $election 2c4 1xchange 2d4 !eletion 'd( Deletion. :sing insertion we can perform insertion sort, using selection we can perform selection sort, using e2change we can perform the bubble sort 'and other similar sorting methods(. %ut no sorting method can be done ;ust using deletion. 1@. 6 .inary tree with 2@ nodes has null .ranches? <3 -et us take a tree with = nodes 'n>=(

!ull %ranches

#t will have only ? 'ie,=93( null branches. #n general, 6 .inary tree with n nodes has exactly n+1 null nodes. 11. What are the methods availa.le in storing se/uential files ? Straight merging, !atural merging, 4olyphase sort, Distribution of #nitial runs.

<

12. )ow many different trees are possi.le with 1@ nodes ? 3@3A .or e2ample, consider a tree with B nodes'n>B(, it will have the ma2imum combination of = different 'ie, <B 7 B > =( trees.

ii

iii

iv

#n general5 +f there are n nodes% there exist 2n-n different trees. 13. List out few of the 6pplication of tree data3structure? *he manipulation of Arithmetic e2pression, Symbol *able construction, Synta2 analysis. 1*. List out few of the applications that ma'e use of #ultilin'ed $tructures? Sparse matri2, #nde2 generation. 1-. +n tree construction which is the suita.le efficient data structure? 2a4 6rray 2.4 Lin'ed list 2c4 $tac' 2d4 Aueue 2e4 none 'b( -inked list 10. What is the type of the algorithm used in solving the 7 Aueens pro.lem? %acktracking 15. +n an 6BL tree% at what condition the .alancing is to .e done? #f the /pivotal value0 'or the /)eight factor0( is greater than 3 or less than &3. 17. What is the .uc'et siCe% when the overlapping and collision occur at same time? One. #f there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. *his results in the overlapping of values.

Visit www.aucse.com A website on big ideas! 1?. Draverse the given tree using +norder% >reorder and >ostorder traversals. "iven tree5

A

"

#norder 5 D ) % 1 A . C # " C 4reorder5 A % D ) 1 C . " # C 4ostorder5 ) D 1 % . # C " C A 2@. Dhere are 7% 1-% 13% 1* nodes were there in * different trees. Which of them could have formed a full .inary tree? 3=. #n general5 Dhere are 2n-1 nodes in a full .inary tree. "y the method of elimination: .ull binary trees contain odd number of nodes. So there cannot be full binary trees with D or 3A nodes, so re;ected. Eith 3B nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 3=. Note: .ull and Complete binary trees are different. 6ll full .inary trees are complete .inary trees .ut not vice versa. 21. +n the given .inary tree% using array you can store the node * at which location? 3

<

A =

Visit www.aucse.com A website on big ideas! At location ? 3 $oot < -C3 B $C3 7 -C< 7 $C< A -CB 7 $CB 7 -CA = $CA

where -Cn means -eft Child of node n and $Cn means $ight Child of node n 22. $ort the given values using Auic' $ort? ?= F@ F= D@ D= ?@ == =@ A=

Sorting takes place from the pivot value, which is the first value of the given elements, this is marked bold. *he values at the left pointer and right pointer are indicated using - and $ respectively. 65 F@F= D@ D= ?@ == =@ A=$

Since pivot is not yet changed the same process is continued after interchanging the values at - and $ positions 65 65 65 65 A= A= A= A= F= =@ =@ =@ D@ D@ == == D= D= D= ?@ $ ?@ ?@ ?@ $ D= == == $ D@ D@ =@ $ F= F= F= F@ F@ F@ F@

Ehen the - and $ pointers cross each other the pivot value is interchanged with the value at right pointer. #f the pivot is changed it means that the pivot has occupied its original position in the sorted order 'shown in bold italics( and hence two different arrays are formed, one from start of the original array to the pivot position73 and the other from pivot position93 to end. 60 55 50 A= A= A= $ =@ =@ $ 55 == $ 60 60 65 65 65 85 70 $ 70 D@ D@ D@ F= F= F= $ F@ $ 85 85

23. <or the given graph% draw the !<$ and "<$?

A G "

"<$: !<$: AG")41 AG)41H

) 1 4

HC C"

H C

2*. ,lassify the )ashing <unctions .ased on the various methods .y which the 'ey value is found. Direct method, Subtraction method, odulo7Division method, Digit712traction method, id7S,uare method, .olding method, 4seudo7random method. 2-. What are the types of ,ollision esolution Dechni/ues and the methods used in each of the type? Open addressing 'closed hashing(, *he methods used include5 Overflow block, Closed addressing 'open hashing( *he methods used include5 -inked list, %inary treeI

20. +n !"#$% what is the efficient data structure used in the internal storage representation?

Visit www.aucse.com A website on big ideas! %9 tree. %ecause in %9 tree, all the data is stored only in leaf nodes, that makes searching easier. *his corresponds to the records that shall be stored in leaf nodes. 25. !raw the "3tree of order 3 created .y inserting the following data arriving in se/uence : ?2 2* 0 5 11 7 22 * - 10 1? 2@ 57

33

3J

<A

3?

<@

<<

FD

J<

27.Ef the following tree structure% which is% efficient considering space and time complexities?

2a4 +ncomplete "inary Dree 2.4 ,omplete "inary Dree 2c4 <ull "inary Dree 'b( Complete %inary *ree. "y the method of elimination: .ull binary tree loses its nature when operations of insertions and deletions are done. .or incomplete binary trees, e2tra storage is re,uired and overhead of !:-- node checking takes place. So complete binary tree is the better one since the property of complete binary tree is maintained even after operations like additions and deletions are done on it. 2?. What is a spanning Dree? A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized. 3@. !oes the minimum spanning tree of a graph give the shortest distance .etween any 2 specified nodes? !o. inimal spanning tree assures that the total weight of the tree is kept at its minimum. %ut it doesnFt mean that the distance between any two nodes involved in the minimum7spanning tree is minimum. 31. ,onvert the given graph with weighted edges to minimal spanning tree.

3

A3@

?@@

?3<

<JD=

B

B3@

<@@

=

A@@

<

3A<3

A3@ <

32. Which is the simplest file structure? 2a4 $e/uential 2.4 +ndexed 2c4 andom 'a( Se,uential 33. Whether Lin'ed List is linear or &on3linear data structure? According to Access strategies -inked list is a linear one. According to Storage -inked -ist is a !on7linear one. 3*. !raw a .inary Dree for the expression : 6 9 " 3 2, 8 !4 9 2> G A4 7 8

3-. <or the following ,E"EL code% draw the "inary tree? C D D 4 L

Visit www.aucse.com A website on big ideas! @3 S*:D1!*M$1C. @< !A 1. @B .#$S*M!A 1 4#C G'3@(. @B -AS*M!A 1 4#C G'3@(. @< H1A$MO.MS*:DH. @B .#$S*MS1 4#C GG. @B S1CO!DMS1 4#C GG. @3 S*:D1!*M$1C

@<

!A 1

@<

H1A$MO.MS*:DH

@B

.#$S*M!A 1

@B

-AS*M!A 1 .#$S*MS1

@B

S1CO!DMS1

@B

- Types and OpetopesUploaded byaaabbbzak
- PS_BasicUploaded byRodrigo Caldeira
- Questions Chapter WiseUploaded bySaravana Priya
- Data StructuresUploaded byMohan Gupta
- Multicast Routing 2Uploaded byBùi Thế Anh
- Relay SchedUploaded byggez_na
- The Introduction of Several GUI Structural Metrics to Make Test Automation More EffectiveUploaded byIzzatAlsmadi
- Tree TopologyUploaded byRampotz Ü Echizen
- 06 BehaviorTreesUploaded byYuelidtha Aaiyu
- A Study of Content Extraction From Web Pages Based on LinksUploaded byLewis Torres
- Greedy_Algorithms.pdfUploaded byskilmag
- BSC Multimedia.pdfUploaded bySwamy
- Doctrine Orm for PhpUploaded byjuanmdq
- 7-Minimum-Spanning-Tree.pdfUploaded byharry_i3t
- Segment TreeUploaded byRahman M.
- Ec6301 Oop&Ds NotesUploaded byprabhuabi143
- Elementary Data Structures - Stacks, Queues, & Lists, Amortized analysis Trees.pptUploaded byedwin5203839
- spr2Uploaded bySamira Beigy
- Lesson 1 NotesUploaded byAnonyvous
- AssignmentUploaded byMircea Nicoleta
- diagram pena.pdfUploaded byRita S Rofa'i
- An Algorithm Template for Domain-Based Parallel Irregular Algorithms.pdfUploaded byjehosha
- Camera Ready-Data MiningUploaded byVijayalakshmi Ramar
- 627_Pro8-KruskalUploaded bydsasdoaiudg
- Course FinalUploaded byTee Si
- Dynamic MemUploaded byadeleno
- Vol5IE123P4Uploaded byJournal of Computer Applications
- HeapsUploaded byRIFKY YUNUS KRISNABAYU
- Network Monitoring using Strategically Placed PMUsUploaded bySatyendra Pratap Singh
- 03 Pointers LLUploaded byfrankjamison

- Backtracking n Queen Problem SimulationUploaded byarunascarlet
- Menog4 Isis TutorialUploaded byarunascarlet
- About DashboardsUploaded byarunascarlet
- Direct DSOUploaded byrk_sathish
- CPP BankAcClassUploaded byarunascarlet
- C SystemClockandDateUploaded byarunascarlet
- C_StringsUploaded byarunascarlet
- C QimplementationofSLLUploaded byarunascarlet
- C PyramitOfNumbersUploaded byarunascarlet
- C PaintBrushUploaded byarunascarlet
- C FileTransferBWtwoCompsUploaded byarunascarlet
- day c programUploaded bySahil
- C ClientServerProgramUsingFIFOUploaded byarunascarlet
- C CalenderUploaded byarunascarlet
- C BankingSystemUploaded byarunascarlet
- ASP PollApplicationUploaded byarunascarlet
- C# and .NETUploaded byarunascarlet
- AttributesUploaded byarunascarlet
- AssembliesUploaded byarunascarlet
- Net RemotingUploaded byarunascarlet
- DungeonUploaded byarunascarlet
- DocoUploaded byskumar4787
- 31 Frameworks for UnderstandingUploaded byvaka_madhu
- C22Uploaded byvijay
- C21Uploaded byvijay
- 10 FunctionsUploaded byyrrah_merp

- C++ NotesUploaded byprasenjit1985
- Array FunctionsUploaded bylionel_sandeep
- E PrimeTipsUploaded byTrầnQuang
- IntroductionUploaded byGeraldoadri
- MATLAB-Introduction to ApplicationsUploaded bynavz143
- ResumeUploaded bymahamariammal
- Lab 1Uploaded byRiyad Tamam
- Railway Pension1Uploaded byjhabhawna
- Datastage Configuration FileUploaded bysrimkb
- JAVAUploaded byanooja
- APLUS 111 User ModelsUploaded byjulis_dh
- Functional coverage.pdfUploaded byanjaliswe
- XSSUploaded byjstefanis
- Computer Programming: Intro to Java Lesson 1Uploaded bymullberry
- 2 Unit TestingUploaded byEel Dde
- Comp-3 To Comp - Decimal ConversionsUploaded bysxdasgu
- Variables (2)Uploaded byJosephine Acar Cano
- Crime Records Management System 1Uploaded bySagar Paul'g
- Selection of Methdology - SAD (Task1) - S.sutharshanUploaded bySutharshan Sharma
- Small Changes Can Bring Big ResultsUploaded byRenu Sharma
- Universal Ticket Booking SystemUploaded byMohit Sharma
- Progrming FundamentalsUploaded byChathura Widanage
- RDBMSUploaded byfcmitc
- Perl 01Uploaded byClaudiu Stefan Haidu
- webspheremessagebrokerapplicationdevelopmentv1-130719115834-phpapp01Uploaded byYaj Bhattacharya
- pdfSAP XI/PI online Training course contentUploaded byRS Trainings
- promises-cheatsheet.pdfUploaded byNenad Trajkovic
- STD-DIDUploaded byEmiliano Pandolfi
- Sap Tao User GuideUploaded byKalpesh Patel
- Lect 28 Verif 1 - Verification Overview.pptUploaded byTalentovani