singly linked list
On Wed, Nov 21, 2012 at 8:21 PM, shady sinv...@gmail.com wrote:
which data structure among the follow has fastest sequential access ?
i) vector
ii) Singly linked list
iii) Doubly linked list
it won't be doubly linked list as it involves more pointer manipulations
Hi
you can first sort the array which can be done in O(nlogn) complexity if
the number of items in the array is n.
Then using the indexing of arrays you can divide the array into two groups
whose difference is going to be maximum and this can be done in O(1)
complexity.
So the complete algorithm
groups whose difference is
maximum in O(1). why max?
solution : http://www.youtube.com/watch?v=GdnpQY2j064
On Fri, Nov 16, 2012 at 9:22 AM, vishal chaudhary
vishal.cs.b...@gmail.com wrote:
Hi
you can first sort the array which can be done in O(nlogn) complexity if
the number of items
then it goes for or and increments the k variable and then k = 7
then it finds that condition k=8 to be true.
now one of the condition in the or is true and it then prints the value of
k as 7
hope this helps u.
Vishal Chaudhary
2012/11/6 Anil Sharma anilsharmau...@gmail.com
main()
{
int
and check whether the left child is less
than the root and root is smaller than the right node.
Warm Regards
Vishal Chaudhary
BE(Hons) Computer Science and Engineering
BITS Pilani
On Tue, Nov 6, 2012 at 12:34 AM, shady sinv...@gmail.com wrote:
Hi,
Can we check this by just doing an inorder