Add linked-list module: singly and doubly lists with measured costs, reverse, middle, Floyd cycle detection, merge and 5 more interview problems, the 2015 menu programs and a doubly-list bug they exposed (15 tests, 15 transcripts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6r9iSyHu5qSJMzH2n
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 1
|
||||
1. Insert at position
|
||||
2. Insert at first
|
||||
3. Insert at last
|
||||
Enter choice: 2
|
||||
Enter element: 10
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 1
|
||||
1. Insert at position
|
||||
2. Insert at first
|
||||
3. Insert at last
|
||||
Enter choice: 3
|
||||
Enter element: 50
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 1
|
||||
1. Insert at position
|
||||
2. Insert at first
|
||||
3. Insert at last
|
||||
Enter choice: 1
|
||||
Enter element: 20
|
||||
Enter position: 2
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 1
|
||||
1. Insert at position
|
||||
2. Insert at first
|
||||
3. Insert at last
|
||||
Enter choice: 3
|
||||
Enter element: 90
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 4
|
||||
List: 10 20 50 90
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 3
|
||||
Enter element to search: 50
|
||||
Element found at position: 3
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 3
|
||||
Enter element to search: 1
|
||||
Element not found
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 2
|
||||
1. Remove first element
|
||||
2. Remove last element
|
||||
3. Remove element at position
|
||||
Enter choice: 1
|
||||
Removed: 10
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 2
|
||||
1. Remove first element
|
||||
2. Remove last element
|
||||
3. Remove element at position
|
||||
Enter choice: 2
|
||||
Removed: 90
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 4
|
||||
List: 20 50
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 1
|
||||
1. Insert at position
|
||||
2. Insert at first
|
||||
3. Insert at last
|
||||
Enter choice: 3
|
||||
Enter element: 80
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 4
|
||||
List: 20 50 80
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 2
|
||||
1. Remove first element
|
||||
2. Remove last element
|
||||
3. Remove element at position
|
||||
Enter choice: 3
|
||||
Enter position: 2
|
||||
Removed: 50
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 4
|
||||
List: 20 80
|
||||
|
||||
--- Singly Linked List Menu ---
|
||||
1. Insert
|
||||
2. Remove
|
||||
3. Search
|
||||
4. Display
|
||||
5. Exit
|
||||
Enter choice: 5
|
||||
Exiting...
|
||||
Reference in New Issue
Block a user