Skip to content

Commit 0b70d67

Browse files
committed
Update README.md
1 parent 4e5b8cc commit 0b70d67

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ the regular expression.
6262
and give the minimum no of comparisons needed on an array of size N to do the
6363
same.
6464

65-
17. Given an array of size n ,containing every element from 1 to n+1, except one.
65+
17.Given an array of size n ,containing every element from 1 to n+1, except one.
6666
Find the missing element.
6767

68-
18. Two trains enter at the opposite sides of a tunnel of length L with speeds 'V'.
68+
18.Two trains enter at the opposite sides of a tunnel of length L with speeds 'V'.
6969
A particle enters the tunnel at the same time with a speed 'v' and it vibrates in
7070
the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the
7171
position of the particle by the time the 2 trains meet?
@@ -74,13 +74,13 @@ position of the particle by the time the 2 trains meet?
7474
number which is repeated in O(n) time .How do you proceed with the same with
7575
floating numbers from 0 to 1 instead of 1 to n?
7676

77-
20. Design a data structure to represent the movement of a knight on a chess
77+
20.Design a data structure to represent the movement of a knight on a chess
7878
board
7979

80-
21. Write an algorithm to traverse a knight covering all the squares on a
80+
21.Write an algorithm to traverse a knight covering all the squares on a
8181
chessboard starting at a particular point.
8282

83-
22. What is wrong with this class, assuming that this is its complete interface?
83+
22.What is wrong with this class, assuming that this is its complete interface?
8484

8585
class C {
8686

@@ -112,7 +112,7 @@ copied]. Now, the original goes out of scope, what happens to the copy? [pointer
112112
dangles]. How would you fix it?
113113
[also, that delete p should be delete[ p since p was allocated with the array new]
114114
Assuming that swap() and copy construction are part of your interface for class C,
115-
what's the cookie-cutter pattern for operator= that uses them?
115+
whats the cookie-cutter pattern for operator= that uses them?
116116
answer:
117117

118118
C& C:perator=(const C &rhs) {
@@ -124,21 +124,23 @@ return *this;
124124
}
125125
]]
126126

127-
23.given two lists write a function which returns a list which is the intersection
127+
23.given two lists write a function which returns a list which is the intersection
128128
of the two lists.the original lists should remain same.
129129
(Intersection – if first list is say,1,20 3,45 and second list is 3,24 ,45,90,68 then
130130
intersection should be 3,45 )
131131

132-
24. Given two nodes of a binary tree find the closest ancestor of the two nodes.
132+
133+
24.Given two nodes of a binary tree find the closest ancestor of the two nodes.
133134
Note:consider binary tree and binary search tree also.
134135

135-
25. Given an array all of whose elements are positive numbers, find the maximum
136+
137+
25.Given an array all of whose elements are positive numbers, find the maximum
136138
sum of a subsequence with the constraint that no 2 numbers in the sequence
137139
should be adjacent in the array.
138140
i) 3 2 7 10 should return 13 (sum of 3 and 10)
139141
ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
140142

141-
26. Given a Binary Search Tree, write a program to print the kth smallest element
143+
26.Given a Binary Search Tree, write a program to print the kth smallest element
142144
without using any static/global variable. You can’t pass the value k to any function
143145
also.
144146

0 commit comments

Comments
 (0)