vietnamese-engineer-in-japan / workshop

All information related to workshop
3 stars 0 forks source link

Workshop - Data structures and algorithms #day2 #3

Open chunvv opened 5 years ago

chunvv commented 5 years ago

Informations:

Contents:

Details: Exs:

chunvv commented 5 years ago

Rules:

chunvv commented 5 years ago

Pre-preparation:

chunvv commented 5 years ago

Documents:

LinkedList:

Screen Shot 2019-05-01 at 10 26 01

Hashtable:

Screen Shot 2019-05-01 at 10 20 30

chunvv commented 5 years ago

LinkedList:

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

chunvv commented 5 years ago

Test 2: Detect if there is a cycle in the list and return its starting point

Screen Shot 2019-05-01 at 11 08 21
chunvv commented 5 years ago

Hashtables

Test 3: Questions where you need to keep track of multiple occurences of same object

chunvv commented 5 years ago

Test 4: Questions where you want to have a 2 tuple as a key

chunvv commented 5 years ago

Divide and Conquer

Test 5: Binary Search

chunvv commented 5 years ago

Test 6: Merge Sort

chunvv commented 5 years ago

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).

chunvv commented 5 years ago

Test 8: MinMaxDivision

Screen Shot 2019-05-01 at 11 14 05
chunvv commented 5 years ago

Test 9: NailingPlanks

Screen Shot 2019-05-01 at 11 14 52
chunvv commented 5 years ago

Maximum slice problem

Test 10: MaxProfit

Screen Shot 2019-05-01 at 11 16 27
chunvv commented 5 years ago

Test 11: MaxSliceSum

Screen Shot 2019-05-01 at 11 18 15
chunvv commented 5 years ago

Test 12: MaxDoubleSliceSum

Screen Shot 2019-05-01 at 11 19 42
chunvv commented 5 years ago

Leader

Test 13: Dominator

Screen Shot 2019-05-01 at 11 20 46
chunvv commented 5 years ago

Test 14: EquiLeader

Screen Shot 2019-05-01 at 11 21 47