DATA STRUCTURE
Programming and Technical
Programming
Technical
Inorder traversal of the following tree
10
/
3 5
/ /
1 7 9 6
a)1 3 7 10 9 5 6
b)1 3 7 9 5 6 10
c)10 3 5 1 7 9 6
d)1 7 9 6 3 5 10
Read Solution (Total 10)
-
- a)1 3 7 10 9 5 6
- 9 years agoHelpfull: Yes(6) No(0)
- Left-root-right
So option a.13710956 - 8 years agoHelpfull: Yes(1) No(0)
- 13795610 inorder
- 8 years agoHelpfull: Yes(0) No(3)
- A,Bcoz in INORDER travesal the result will be RIGHT SUB TREE,ROOT NODE,LEFT SUB TREE
- 8 years agoHelpfull: Yes(0) No(0)
- option A
left root and thn right node
- 8 years agoHelpfull: Yes(0) No(0)
- process left subtree->process node->process right subtree
- 8 years agoHelpfull: Yes(0) No(0)
- Ans-a
inorder procedure -left node->root node->right node
- 8 years agoHelpfull: Yes(0) No(0)
- C because first it process the root node, later left subtree etc..
- 1 year agoHelpfull: Yes(0) No(1)
- Sorry answer is c bcoz first it process left sub tree then root node later right sub tree etc...
- 1 year agoHelpfull: Yes(0) No(0)
- Answer a because it process left subtree then root node and then right sub tree etc..
- 1 year agoHelpfull: Yes(0) No(0)
DATA STRUCTURE Other Question
A level order traversal in a binary tree requires which data structure?
a)stack b)Deque
c)Linked List d)DoublLinked list
Your job is to build a data structure to maintain a set of photographs. Your photograph database should allow you to insert and search for photographs, as well as to designate some of the photographs as favourites by marking them. In more detail, your data structure should support the following operations:
• Insert(x, t, m): inserts photograph x that was taken at time t. If m = 1, then the photograph is marked as a favourite; if m = 0, then it is not a favourite.
• Search(t): find the next photograph taken after time t.
• NextFavorite(t): find the next photograph taken after time t that is a favourite.
Give a data structure for solving this problem, and explain how it works. For more efficiency, your data structure should be both time and space efficient: more points will be given for more efficient solutions. (Remember that the photographs themselves may be quite large.) Give the performance (i.e., running time) of each operation and the space usage of the data structure. You may assume that at any given time t, your camera has taken at most one photograph x. Describe your solution in words, or very high-level pseudocode. You do not need to provide complete details. You must provide enough detail, however, that your solution is clear.