Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~166 People Reached
Favorite Forums
Member Avatar for imtiazm_71267

[COLOR=black]Given a list of [/COLOR][COLOR=black]N [/COLOR][COLOR=black]integers, the 3-sum problem is to determine whether there exists 3 integers in the list (not necessarily distinct) such that [/COLOR][COLOR=black]x + y + z = 0[/COLOR][COLOR=black]. Suppose that you are executing the brute force algorithm below on a computer that executes 1 billion operations …

Member Avatar for Rashakil Fol
0
58
Member Avatar for imtiazm_71267

[COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][int count(Node * list)[COLOR=windowtext][/COLOR][/COLOR] [COLOR=#000000]{ [/COLOR] [COLOR=#000000]if (list == Null) [/COLOR] [COLOR=#000000]return 0; [/COLOR] [COLOR=#000000]else [/COLOR] [COLOR=#000000]return 1 + count(list->next); [/COLOR] [COLOR=#000000]} [/COLOR] [COLOR=#000000]Write a recurrence relation for the function count.][COLOR=windowtext][/COLOR][/COLOR]

Member Avatar for Rashakil Fol
0
65
Member Avatar for imtiazm_71267

[COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][/COLOR] [COLOR=#000000][function exp(k, n) [/COLOR] [COLOR=#000000]{ [/COLOR] [COLOR=#000000]power := 1; [/COLOR] [COLOR=#000000]for i := 1 to n do [/COLOR] [COLOR=#000000]power := power * k; [/COLOR] [COLOR=#000000]return(power) [/COLOR] [COLOR=black]}] [/COLOR]

Member Avatar for Rashakil Fol
0
43