Open chunvv opened 5 years ago
Rules:
Pre-preparation:
Linked List: (5m)
Hashtable: (5m)
Hash collisions
Documents:
LinkedList:
Hashtable:
Test 1: Reverse a singly linked list Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing links between nodes.
Examples:
Input : Head of following linked list
1->2->3->4->NULL
Output : Linked list should be changed to,
4->3->2->1->NULL
Input : Head of following linked list
1->2->3->4->5->NULL
Output : Linked list should be changed to,
5->4->3->2->1->NULL
Input : NULL Output : NULL
Input : 1->NULL Output : 1->NULL
Test 2: Detect if there is a cycle in the list and return its starting point
Test 3: Questions where you need to keep track of multiple occurences of same object
Test 4: Questions where you want to have a 2 tuple as a key
Test 5: Binary Search
Test 6: Merge Sort
Test 7: Maximum Subarray Sum
You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has the largest sum. For example, if the given array is {-2, -5, 6, -2, -3, 1, 5, -6}, then the maximum subarray sum is 7 (see highlighted elements).
Test 8: MinMaxDivision
Test 9: NailingPlanks
Test 10: MaxProfit
Test 11: MaxSliceSum
Test 12: MaxDoubleSliceSum
Test 13: Dominator
Test 14: EquiLeader
Informations:
Contents:
Details: Exs:
Linked List:
Hashtables:
Divide and Conquer
Maximum slice problem
Leader