Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IF - 43 - 05 || Group 4 #281

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ASD_Task_1.depend
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@

1516168119 c:\users\andityaarifianto\documents\github\asd_task_1\asd_task_1.h

1579880206 source:c:\users\computer\documents\github\asd_task_1\main.cpp
<iostream>

2 changes: 1 addition & 1 deletion ASD_Task_1.layout
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="461" topLine="0" />
<Cursor1 position="461" topLine="9" />
</Cursor>
</File>
</CodeBlocks_layout_file>
Binary file modified bin/Debug/ASD_Task_1.exe
Binary file not shown.
27 changes: 16 additions & 11 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using namespace std;


/** WRITE DOWN YOUR INFORMATION HERE */

string name = ""; // put your name here
string ID = ""; // put your student id here
int group_id = 0; // your Group Number here (1-8)
Expand Down Expand Up @@ -102,10 +103,8 @@ void insert_last(int arr[], int &n, int x) {
*/

// YOUR CODES HERE
//-----------------------


//-----------------------
arr[n] = x;
n++;
}


Expand All @@ -118,10 +117,16 @@ void search_and_delete(int arr[], int &n, int x) {
*/

// YOUR CODES HERE
//-----------------------


//-----------------------
for (int i = 0; i < n; i++) {
if (arr[i] == x) {
arr[i] = 0;
for (int j = i ; j < n ; j++) {
swap(arr[j], arr[j+1]);
}
n--;
}
}
}


Expand Down Expand Up @@ -213,10 +218,10 @@ void view_data_2(int arr[], int n) {
*/

// YOUR CODES HERE
//-----------------------


//-----------------------
for (int i = n-1; i >= 0 ; i--) {
cout << arr[i] << " ";
}
cout << endl;
}


Expand Down
Binary file modified obj/Debug/main.o
Binary file not shown.