Tue Jun 19 09:56:25 2018
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2015-01-01

LEARN

2018-06-19 | 2018-05-19 | 2018-04-19 | 2018-03-19 | 2018-02-19 | 2018-01-19 | 2017-12-19 | 2017-11-19 | 2017-10-19 | 2017-09-19 | 2017-08-19 | 2017-07-19 | 2017-06-19 | 2017-05-19 | 2017-04-19 | 2017-03-19 | 2017-02-19 | 2017-01-19 | 2016-12-19 | 2016-11-19 | 2016-10-19 | 2016-09-19 | 2016-08-19 | 2016-07-19 | 2016-06-19 | 2016-05-19 | 2016-04-19 | 2016-03-19 | 2016-02-19 | 2016-01-19 | 2015-12-19 | 2015-11-19 | 2015-10-19 | 2015-09-19 | 2015-08-19 | 2015-07-19 | 2015-06-19 | 2015-05-19 | 2015-04-19 | 2015-03-19 | 2015-02-19 | 2015-01-19 | 2014-12-19 | 2014-11-19 | 2014-10-19

Key: id Value: 542850

Key: archive_learn Value: 2015-01-01

MESSAGE
DATE 2015-01-23
FROM Kamran
SUBJECT Re: [LIU Comp Sci] study hall today
From owner-learn-outgoing-at-mrbrklyn.com Fri Jan 23 11:47:39 2015
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: by mrbrklyn.com (Postfix)
id 9E0EF16117A; Fri, 23 Jan 2015 11:47:39 -0500 (EST)
Delivered-To: learn-outgoing-at-mrbrklyn.com
Received: by mrbrklyn.com (Postfix, from userid 28)
id 8BD7C16118F; Fri, 23 Jan 2015 11:47:39 -0500 (EST)
Delivered-To: learn-at-mrbrklyn.com
Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47])
by mrbrklyn.com (Postfix) with ESMTP id C4F7916117A
for ; Fri, 23 Jan 2015 11:47:38 -0500 (EST)
Received: by mail-qa0-f47.google.com with SMTP id n8so6606793qaq.6
for ; Fri, 23 Jan 2015 08:47:38 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
:subject:references:in-reply-to:content-type
:content-transfer-encoding;
bh=+wmfl7ypaP3iJ0K2kDjU/CODO9loqcs0xKmCvhuuNr4=;
b=DFTpLhsKSTYzjkI/CPYk4a8mN4vu+qKw7MeMlvi6mcESrVjKE7eqSSfisEijNhqAUj
v9CVM/JOLqY8l1393BgBSlAivx/0XBADsQ+RSy8oJJ05XEsCf9mPnj7whMw4aw99SQxv
NxzVRA91oIBuB6XIsF6X2mDThauLcqottYSEmj38lhiyUqP7hcLSvIz+3dOXFnWlYS7E
hzH4AsZttZ55q30nLDGB4z/8S0pgiDlKS+mdHNuTFFrDQly7F6S0DLiU4yR33Ig4QCW8
qxFK+i8X+tAWiZmq7V4UJ/fZ8JjtxuDfgUTJrM67BdTjKgqBO6PG9D1ilVeefEuA6mR5
dz3g==
X-Gm-Message-State: ALoCoQk7qjvZIWgwf4XndUq6j2p+MlFqmgclmIAEugQjXq4LCQhJ4lvPiLXrqeMoukcK8ZMg3Ivr
X-Received: by 10.140.102.165 with SMTP id w34mr13700157qge.26.1422031658126;
Fri, 23 Jan 2015 08:47:38 -0800 (PST)
Received: from [148.4.237.140] (182631b.cst.lightpath.net. [24.38.3.27])
by mx.google.com with ESMTPSA id r2sm1943819qah.1.2015.01.23.08.47.33
for
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 23 Jan 2015 08:47:37 -0800 (PST)
Message-ID: <54C27B20.2060808-at-my.liu.edu>
Date: Fri, 23 Jan 2015 11:47:28 -0500
From: Kamran
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
MIME-Version: 1.0
To: learn-at-mrbrklyn.com
Subject: Re: [LIU Comp Sci] study hall today
References: <548EDC03.4030704-at-my.liu.edu> <548EEBDD.3060804-at-my.liu.edu> <548EED54.3060702-at-my.liu.edu> <548EED98.10908-at-my.liu.edu> <5491C69E.2090901-at-my.liu.edu> <5491C805.2040808-at-my.liu.edu> <54C19D2E.5070305-at-panix.com>
In-Reply-To: <54C19D2E.5070305-at-panix.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-learn-at-mrbrklyn.com
Precedence: bulk
Reply-To: learn-at-mrbrklyn.com

Hi Ruben, yes i did. Here is a code of the assignment:



#include
#include
using namespace std;

struct List {
int *a;
int n;
int last;
};

List NewList(int max_size)
{
List L;

L.a = new int[max_size];
L.n = max_size;
L.last = -1;

return L;
}

// Precondition: 0 <= pos <= L.last+1
void InsertAtPosition(List& L, int val, int pos)
{
for (int i = L.last; i >= pos; i--) {
L.a[i+1] = L.a[i];
}

L.a[pos] = val;
L.last++;
}

// Precondition: 0 <= pos <= L.last
void DeleteAtPosition(List& L, int pos)
{
// For you to do

if ((pos > L.last) || (pos < 0)) {
cout << endl;
cout << "Invalid position number" << endl;
return;
}

for (int i = pos; i < L.last; i++) {
L.a[i] = L.a[i+1];
}

L.last--;
}

void InsertFirst(List& L, int val)
{
InsertAtPosition(L, val, 0);
}

void InsertLast(List& L, int val)
{
// For you to do

InsertAtPosition(L, val, L.last + 1);


}

void DeleteFirst(List& L)
{
// For you to do

DeleteAtPosition(L, 0);

}

void DeleteLast(List& L)
{
// For you to do

DeleteAtPosition(L, L.last);

}

bool IsFull(List& L)
{
return L.last == L.n;
}

bool IsEmpty(List& L)
{
// For you to do
return L.last == -1;

}

void PrintList(const List& L)
{
for (int i = 0; i <= L.last; i++) {
cout << L.a[i] << " ";
}
}


int main()
{
int val;
List L = NewList(100);

while(cout << "Enter value to be inserted (CTL-D to end): ", cin >>
val) {
if (! IsFull(L))
InsertFirst(L, val);
else
break;
}

cout << endl << endl;
PrintList(L);
cout << endl;

cin.clear();

// For you to do: Add code to test the functions you wrote.

int pos;

while(cout << "Enter value to be inserted at the end of the list
(CTL-D to end): ", cin >> val)
{
if (! IsFull(L))
{
InsertLast(L, val);
cout << endl;
PrintList(L);
cout << endl;
}
else
break;
}
cout << endl << endl;
PrintList(L);
cout << endl;
cin.clear();

while(cout << "Enter position of value to be deleted (CTL-D to
end): ", cin >> pos)
{
if (! IsEmpty(L))
{
if (pos == 0)
{
DeleteFirst(L);
cout << endl;
PrintList(L);
cout << endl;
}
else if (pos == L.last)
{
DeleteLast(L);
cout << endl;
PrintList(L);
cout << endl;
}
else
{
DeleteAtPosition(L, pos);
cout << endl;
PrintList(L);
cout << endl;
}
}
else
break;
}
cout << endl;
PrintList(L);
cin.clear();

return EXIT_SUCCESS;
}




On 1/22/2015 8:00 PM, Ruben Safir wrote:
> Kamran, do you have any work done yet from that assignment?
>

--
Best regards,
Kamran Mirzoyev

  1. 2015-01-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] databse normalzation resources
  2. 2015-01-04 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Future of Computer Education
  3. 2015-01-04 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Re: [NYLXS - HANGOUT] Future of Computer Education
  4. 2015-01-21 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] pinging new semester...
  5. 2015-01-21 duodujames <duodujames-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  6. 2015-01-21 Maneesh Kongara <maneeshkongara-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  7. 2015-01-21 duodujames <duodujames-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  8. 2015-01-21 Maneesh Kongara <maneeshkongara-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  9. 2015-01-21 duodujames <duodujames-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  10. 2015-01-21 Maneesh Kongara <maneeshkongara-at-gmail.com> RE: [LIU Comp Sci] pinging new semester...
  11. 2015-01-21 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] pinging new semester...
  12. 2015-01-21 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] pinging new semester...
  13. 2015-01-21 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] pinging new semester...
  14. 2015-01-21 duodujames <duodujames-at-gmail.com> Re: [LIU Comp Sci] pinging new semester...
  15. 2015-01-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Class Virtual Machine
  16. 2015-01-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] pinging new semester...
  17. 2015-01-22 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  18. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  19. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  20. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  21. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  22. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  23. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  24. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  25. 2015-01-22 Ruben <ruben.safir-at-my.liu.edu> Re: [LIU Comp Sci] Normalization review
  26. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  27. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  28. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  29. 2015-01-22 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  30. 2015-01-22 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  31. 2015-01-22 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  32. 2015-01-22 Sergei Glikstein <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  33. 2015-01-22 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  34. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] study hall today
  35. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Algorithms Assignment 1 attempt
  36. 2015-01-22 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Algoritms
  37. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  38. 2015-01-23 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  39. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  40. 2015-01-23 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  41. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Algorithms Assignment 1 attempt
  42. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  43. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  44. 2015-01-23 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  45. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  46. 2015-01-23 From: "Serge Glikstein" <serge.gl-at-gmail.com> Re: [LIU Comp Sci] Normalization review
  47. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Normalization review
  48. 2015-01-23 Kamran <kamran.mirzayev-at-my.liu.edu> Re: [LIU Comp Sci] study hall today
  49. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Re: [NYLXS - HANGOUT] Linux Job Crunch
  50. 2015-01-23 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Software compexity and history - must see video
  51. 2015-01-26 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Weather Emergency!!
  52. 2015-01-28 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] making the class up on the fly
  53. 2015-01-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] making the class up on the fly
  54. 2015-01-28 Tony Genao <tony.genao-at-my.liu.edu> Re: [LIU Comp Sci] making the class up on the fly
  55. 2015-01-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] making the class up on the fly
  56. 2015-01-28 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] making the class up on the fly
  57. 2015-01-28 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] making the class up on the fly
  58. 2015-01-28 mrbrklyn-at-panix.com Subject: [LIU Comp Sci] NYLUG Open hacker hours
  59. 2015-01-28 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Operating Systems gibberish
  60. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] making the class up on the fly
  61. 2015-01-29 muhammad rizwan khalid <rizwankhalid316-at-gmail.com> Re: [LIU Comp Sci] making the class up on the fly
  62. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] making the class up on the fly
  63. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Operating System Interupts
  64. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Operating System Interupts
  65. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Operating System Interupts
  66. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Operating System Interupts
  67. 2015-01-29 Ruben <ruben.safir-at-my.liu.edu> Re: [LIU Comp Sci] Operating System Interupts
  68. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] LIU mailing list FAQ
  69. 2015-01-29 mrbrklyn-at-panix.com Subject: [LIU Comp Sci] nixCraft Linux / UNIX Newsletter
  70. 2015-01-29 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Operating System Interupts
  71. 2015-01-30 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Operating System Interupts
  72. 2015-01-31 Maneesh Kongara <maneeshkongara-at-gmail.com> Re: [LIU Comp Sci] Linked List Homework
  73. 2015-01-31 Ruben Safir <mrbrklyn-at-panix.com> Re: [LIU Comp Sci] Linked List Homework
  74. 2015-01-31 Ruben Safir <mrbrklyn-at-panix.com> Subject: [LIU Comp Sci] Linked List Homework
  75. 2015-01-31 mrbrklyn-at-panix.com Subject: [LIU Comp Sci] linkedlist example

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!