Get_RiGhT
BAN USER
Comments (6)
Reputation -15
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
no,... pointer c will be pointing to some garbage location in the memory if u haven't initialized it ....so at every run for *c and c there may be different values... in the case when your pointer is containing null address and u tries to dereference it ,then it will produce segmentaion fault.
- Get_RiGhT August 25, 2012Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
take two pointers say i and j. at starting i is pointing to a[0] , and traverse the array with the pointer j. if fun(a[j])==1 ,then then replace a[j] with a[i] and increment both pointer i.e. i++ and j++. time complexity O(n).
- Get_RiGhT August 27, 2012